1
0
mirror of https://github.com/akpaevj/OneSTools.TechLog.git synced 2024-12-06 08:16:09 +02:00

Исправлена ошибка получения первой строки контекста

This commit is contained in:
Акпаев Евгений Александрович 2020-12-12 02:25:50 +03:00
parent 8f7c44613a
commit b496584488
4 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,7 @@ namespace OneSTools.TechLog
{
None,
SqlHash,
CleanedSql,
CleanSql,
FirstContextLine,
LastContextLine,
EndPosition

View File

@ -9,7 +9,7 @@
<PackageProjectUrl>https://github.com/akpaevj/OneSTools.TechLog</PackageProjectUrl>
<Copyright>Akpaev Evgeny</Copyright>
<Description>Библиотека для парсинга технологического журнала 1С</Description>
<Version>2.1.1</Version>
<Version>2.1.2</Version>
<LangVersion>8.0</LangVersion>
<PackageIcon>onestools_icon_nuget.png</PackageIcon>
<PackageLicenseExpression></PackageLicenseExpression>

View File

@ -241,7 +241,7 @@ namespace OneSTools.TechLog
private bool TrySetCleanSqlProperty(TechLogItem item)
{
if (NeedAdditionalProperty(AdditionalProperty.CleanedSql) && item.TryGetPropertyValue("Sql", out var sql))
if (NeedAdditionalProperty(AdditionalProperty.CleanSql) && item.TryGetPropertyValue("Sql", out var sql))
{
item["CleanSql"] = ClearSql(sql);
@ -315,10 +315,10 @@ namespace OneSTools.TechLog
private string GetFirstContextLine(string context)
{
var index = context.IndexOf("\n");
var index = context.IndexOf('\n');
if (index > 0)
return context[0..index];
return context[0..index].Trim();
else
return context;
}
@ -337,10 +337,10 @@ namespace OneSTools.TechLog
private string GetLastContextLine(string context)
{
var index = context.LastIndexOf("\t");
var index = context.LastIndexOf('\t');
if (index > 0)
return context[(index + 1)..];
return context[(index + 1)..].Trim();
else
return context;
}

View File

@ -15,8 +15,8 @@ namespace OneSTools.TechLogTestApp
var folderReaderSettings = new TechLogReaderSettings()
{
LogFolder = @"C:\Users\akpaev.e.ENTERPRISE\Desktop\TechLog",
Properties = new List<string>() { "Sql", "Context" },
AdditionalProperty = AdditionalProperty.SqlHash | AdditionalProperty.FirstContextLine | AdditionalProperty.LastContextLine | AdditionalProperty.EndPosition,
//Properties = new List<string>() { "Sql", "Context" },
AdditionalProperty = AdditionalProperty.FirstContextLine,
BatchSize = 100,
BatchFactor = 2,
LiveMode = false