Skip to content

Commit a93d46e

Browse files
v8.0.0
1 parent 44999b6 commit a93d46e

File tree

8 files changed

+24
-26
lines changed

8 files changed

+24
-26
lines changed

.editorconfig

+10-7
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ csharp_style_expression_bodied_operators = false:silent
9191
csharp_style_expression_bodied_properties = true:silent
9292

9393
# Pattern matching preferences
94-
csharp_style_pattern_matching_over_as_with_null_check = true
95-
csharp_style_pattern_matching_over_is_with_cast_check = true
96-
csharp_style_prefer_extended_property_pattern = true
97-
csharp_style_prefer_not_pattern = true
98-
csharp_style_prefer_pattern_matching = true
99-
csharp_style_prefer_switch_expression = true
94+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
95+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
96+
csharp_style_prefer_extended_property_pattern = true:suggestion
97+
csharp_style_prefer_not_pattern = true:suggestion
98+
csharp_style_prefer_pattern_matching = true:silent
99+
csharp_style_prefer_switch_expression = true:suggestion
100100

101101
# Null-checking preferences
102102
csharp_style_conditional_delegate_call = true
@@ -274,6 +274,8 @@ dotnet_diagnostic.SA1108.severity = silent
274274
dotnet_diagnostic.SA1012.severity = error
275275
dotnet_diagnostic.SA1500.severity = error
276276
dotnet_diagnostic.SA1316.severity = error
277+
csharp_prefer_system_threading_lock = true:suggestion
278+
dotnet_diagnostic.MA0132.severity = error
277279

278280
[*.{cs,vb}]
279281
dotnet_style_operator_placement_when_wrapping = beginning_of_line
@@ -297,4 +299,5 @@ dotnet_style_predefined_type_for_locals_parameters_members = true:silent
297299
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
298300
dotnet_code_quality_unused_parameters = all:suggestion
299301
dotnet_diagnostic.CA2200.severity = error
300-
dotnet_diagnostic.CA1012.severity = error
302+
dotnet_diagnostic.CA1012.severity = error
303+
dotnet_style_namespace_match_folder = true:suggestion

.github/workflows/dotnet-core-desktop.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
configuration: [Release, Debug]
15+
configuration: [Release]
1616

1717
runs-on: windows-latest # For a list of available runner types, refer to
1818
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
@@ -23,13 +23,13 @@ jobs:
2323

2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4.2.2
2727
with:
2828
fetch-depth: 0
2929

3030
# Install the .NET Core workload
3131
- name: Install .NET Core
32-
uses: actions/setup-dotnet@v4.1.0
32+
uses: actions/setup-dotnet@v4.2.0
3333
with:
3434
dotnet-version: 9.0.x
3535

@@ -54,7 +54,7 @@ jobs:
5454

5555
# Publish Artifacts
5656
- name: 'Publish Artifacts'
57-
uses: actions/[email protected].0
57+
uses: actions/[email protected].3
5858
with:
5959
name: artifactory_${{ matrix.configuration }}
6060
path: ./Analogy.LogViewer.Log4jXml/bin/${{ matrix.configuration }}
@@ -64,19 +64,18 @@ jobs:
6464
if: ${{ github.event_name == 'push'}}
6565
runs-on: windows-latest
6666
steps:
67+
- name: Setup NuGet.exe for use with actions
68+
uses: NuGet/[email protected]
6769
- name: 'Download Artifact'
6870
uses: actions/[email protected]
6971
with:
7072
name: artifactory_Release
7173
- name: 'Dotnet NuGet Push'
7274
run: |
7375
Get-ChildItem ./ -Filter *.nupkg |
74-
Where-Object { !$_.Name.Contains('preview') } |
7576
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
7677
shell: pwsh
7778

78-
- name: Setup NuGet.exe for use with actions
79-
uses: NuGet/[email protected]
8079
concurrency:
8180
group: ${{ github.ref }}
8281
cancel-in-progress: true

Analogy.LogViewer.Log4jXml/Analogy.LogViewer.Log4jXml.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageProjectUrl>https://github.com/Analogy-LogViewer/Analogy.LogViewer.Log4jXml</PackageProjectUrl>
1010
<RepositoryUrl>https://github.com/Analogy-LogViewer/Analogy.LogViewer.Log4jXml</RepositoryUrl>
1111
<PackageReleaseNotes>Analogy Nlog Log4Jxml parser</PackageReleaseNotes>
12-
<VersionPrefix>7.2.0</VersionPrefix>
12+
<VersionPrefix>8.0.0</VersionPrefix>
1313
<VersionSuffix></VersionSuffix>
1414
<Company>Analogy.LogViewer</Company>
1515
<PackageIcon>Log4jXml.png</PackageIcon>
@@ -27,8 +27,8 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="7.2.0" />
31-
<PackageReference Include="Analogy.LogViewer.Template" Version="7.2.0" />
30+
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="8.0.0" />
31+
<PackageReference Include="Analogy.LogViewer.Template" Version="8.0.0" />
3232
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3333
<PackageReference Include="System.Resources.Extensions" Version="9.0.1" />
3434
</ItemGroup>

Analogy.LogViewer.Log4jXml/Core/Log/LogMessage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public string MessageSingleLine
6060
/// <summary>
6161
/// Time Stamp.
6262
/// </summary>
63-
public DateTime TimeStamp { get; set; }
63+
public DateTimeOffset TimeStamp { get; set; }
6464

6565
/// <summary>
6666
/// Properties collection.

Analogy.LogViewer.Log4jXml/Core/Readers/Parsers/FlatLogParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private LogMessage ParseExactTemplateOrDefault(string logEvent)
5353
}
5454

5555
var timestampRaw = logEvent.Substring(0, indexOfOpenBracket);
56-
if (!DateTime.TryParseExact(timestampRaw, "yyyy-MM-dd HH:mm:ss.fff zzz", CultureInfo.InvariantCulture, DateTimeStyles.None, out var timestamp))
56+
if (!DateTimeOffset.TryParseExact(timestampRaw, "yyyy-MM-dd HH:mm:ss.fff zzz", CultureInfo.InvariantCulture, DateTimeStyles.None, out var timestamp))
5757
{
5858
return null;
5959
}

Analogy.LogViewer.Log4jXml/Core/Readers/Parsers/Log4jParser.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected override LogMessage ParseLogEvent(XmlReader reader)
6060

6161
if (long.TryParse(reader.GetAttribute("timestamp"), out var timeStamp))
6262
{
63-
logMsg.TimeStamp = ToDateTime(timeStamp);
63+
logMsg.TimeStamp = new DateTimeOffset(S1970.AddMilliseconds(timeStamp));
6464
}
6565

6666
int eventDepth = reader.Depth;
@@ -136,10 +136,5 @@ protected override XmlParserContext GetXmlParserContext()
136136
{
137137
return _xmlContext;
138138
}
139-
140-
public static DateTime ToDateTime(long timeStamp)
141-
{
142-
return S1970.AddMilliseconds(timeStamp);
143-
}
144139
}
145140
}

Analogy.LogViewer.Log4jXml/Core/Readers/Parsers/LogParserExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static LogMessage TryParseLogEvent(this ILogParser logParser, string logE
2323
LoggerName = defaultLogger,
2424
ThreadName = "NA",
2525
Message = logEvent,
26-
TimeStamp = DateTime.Now,
26+
TimeStamp = DateTimeOffset.Now,
2727
LogLevel = LogLevel.Info,
2828
ExceptionString = e.Message,
2929
};

Analogy.LogViewer.Log4jXml/IAnalogy/OfflineDataProvider.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Analogy.Interfaces;
2+
using Analogy.Interfaces.DataTypes;
23
using Logazmic.Core.Log;
34
using Logazmic.Core.Readers;
45
using Logazmic.Core.Receiver;

0 commit comments

Comments
 (0)