Skip to content

Commit caeefb0

Browse files
Randall FlaggRandall Flagg
Randall Flagg
authored and
Randall Flagg
committed
Merge branch 'Development' of https://github.com/LogExperts/LogExpert into dockpanelsuite
2 parents 91ec3a3 + 4a7fcd0 commit caeefb0

12 files changed

+371
-354
lines changed

build/Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Version Version
7878
patch = AppVeyor.Instance.BuildNumber;
7979
}
8080

81-
return new Version(1, 11, 2, patch);
81+
return new Version(1, 12, 0, patch);
8282
}
8383
}
8484

src/CsvColumnizer/CsvColumnizerConfigDlg.Designer.cs

Lines changed: 202 additions & 205 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CsvColumnizer/CsvColumnizerConfigDlg.cs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Drawing;
23
using System.Windows.Forms;
34

45
namespace CsvColumnizer
@@ -15,9 +16,14 @@ public partial class CsvColumnizerConfigDlg : Form
1516

1617
public CsvColumnizerConfigDlg(CsvColumnizerConfig config)
1718
{
19+
SuspendLayout();
20+
AutoScaleDimensions = new SizeF(96F, 96F);
21+
AutoScaleMode = AutoScaleMode.Dpi;
22+
1823
_config = config;
1924
InitializeComponent();
2025
FillValues();
26+
ResumeLayout();
2127
}
2228

2329
#endregion
@@ -27,23 +33,23 @@ public CsvColumnizerConfigDlg(CsvColumnizerConfig config)
2733
private void FillValues()
2834
{
2935
delimiterTextBox.Text = _config.DelimiterChar;
30-
quoteCharTextBox.Text = _config.QuoteChar.ToString();
31-
escapeCharTextBox.Text = _config.EscapeChar.ToString();
32-
escapeCheckBox.Checked = _config.EscapeChar != '\0';
33-
commentCharTextBox.Text = _config.CommentChar.ToString();
34-
fieldNamesCheckBox.Checked = _config.HasFieldNames;
35-
escapeCharTextBox.Enabled = escapeCheckBox.Checked;
36-
minColumnsNumericUpDown.Value = _config.MinColumns;
36+
textBoxQuoteChar.Text = _config.QuoteChar.ToString();
37+
textboxEscapeChar.Text = _config.EscapeChar.ToString();
38+
checkBoxEscape.Checked = _config.EscapeChar != '\0';
39+
textBoxCommentChar.Text = _config.CommentChar.ToString();
40+
checkBoxFieldNames.Checked = _config.HasFieldNames;
41+
textboxEscapeChar.Enabled = checkBoxEscape.Checked;
42+
numericUpDownMinColumns.Value = _config.MinColumns;
3743
}
3844

3945
private void RetrieveValues()
4046
{
4147
_config.DelimiterChar = delimiterTextBox.Text;
42-
_config.QuoteChar = quoteCharTextBox.Text[0];
43-
_config.EscapeChar = escapeCheckBox.Checked ? escapeCharTextBox.Text[0] : '\0';
44-
_config.CommentChar = commentCharTextBox.Text[0];
45-
_config.HasFieldNames = fieldNamesCheckBox.Checked;
46-
_config.MinColumns = (int) minColumnsNumericUpDown.Value;
48+
_config.QuoteChar = textBoxQuoteChar.Text[0];
49+
_config.EscapeChar = checkBoxEscape.Checked ? textboxEscapeChar.Text[0] : '\0';
50+
_config.CommentChar = textBoxCommentChar.Text[0];
51+
_config.HasFieldNames = checkBoxFieldNames.Checked;
52+
_config.MinColumns = (int)numericUpDownMinColumns.Value;
4753
}
4854

4955
#endregion
@@ -57,9 +63,10 @@ private void OnOkButtonClick(object sender, EventArgs e)
5763

5864
private void OnEscapeCheckBoxCheckedChanged(object sender, EventArgs e)
5965
{
60-
escapeCharTextBox.Enabled = escapeCheckBox.Checked;
66+
textboxEscapeChar.Enabled = checkBoxEscape.Checked;
6167
}
6268

6369
#endregion
70+
6471
}
6572
}

src/CsvColumnizer/CsvColumnizerConfigDlg.resx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->

src/Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<PackageVersion Include="CsvHelper" Version="33.0.1" />
1010
<PackageVersion Include="GitVersion.CommandLine" Version="5.12.0" />
1111
<PackageVersion Include="GitVersion.Core" Version="6.1.0" />
12-
<PackageVersion Include="Google.Protobuf" Version="3.29.3" />
13-
<PackageVersion Include="Grpc.AspNetCore" Version="2.67.0" />
12+
<PackageVersion Include="Google.Protobuf" Version="3.30.1" />
13+
<PackageVersion Include="Grpc.AspNetCore" Version="2.70.0" />
1414
<PackageVersion Include="Grpc.Core" Version="2.46.6" />
15-
<PackageVersion Include="Grpc.Tools" Version="2.70.0" />
15+
<PackageVersion Include="Grpc.Tools" Version="2.71.0" />
1616
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
1717
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1818
<PackageVersion Include="Moq" Version="4.20.72" />

src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Newtonsoft.Json;
2+
23
using System;
34
using System.Collections.Generic;
45
using System.Globalization;
@@ -221,7 +222,6 @@ public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLin
221222

222223
Column[] columns = Column.CreateColumns(COLUMN_COUNT, clogLine);
223224

224-
225225
// If the line is too short (i.e. does not follow the format for this columnizer) return the whole line content
226226
// in colum 8 (the log message column). Date and time column will be left blank.
227227
if (line.FullLine.Length < 15)
@@ -233,10 +233,12 @@ public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLin
233233
try
234234
{
235235
DateTime dateTime = GetTimestamp(callback, line);
236+
236237
if (dateTime == DateTime.MinValue)
237238
{
238239
columns[8].FullValue = line.FullLine;
239240
}
241+
240242
string newDate = dateTime.ToString(DATETIME_FORMAT);
241243
columns[0].FullValue = newDate;
242244
}
@@ -305,6 +307,7 @@ public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
305307
}
306308

307309
int endIndex = line.FullLine.IndexOf(separatorChar, 1);
310+
308311
if (endIndex > 20 || endIndex < 0)
309312
{
310313
return DateTime.MinValue;
@@ -314,12 +317,12 @@ public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
314317
try
315318
{
316319
// convert log4j timestamp into a readable format:
317-
long timestamp;
318-
if (long.TryParse(value, out timestamp))
320+
if (long.TryParse(value, out long timestamp))
319321
{
320322
// Add the time offset before returning
321323
DateTime dateTime = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
322324
dateTime = dateTime.AddMilliseconds(timestamp);
325+
323326
if (_config.localTimestamps)
324327
{
325328
dateTime = dateTime.ToLocalTime();
@@ -347,7 +350,7 @@ public void PushValue(ILogLineColumnizerCallback callback, int column, string va
347350
DateTime oldDateTime = DateTime.ParseExact(oldValue, DATETIME_FORMAT, cultureInfo);
348351
long mSecsOld = oldDateTime.Ticks / TimeSpan.TicksPerMillisecond;
349352
long mSecsNew = newDateTime.Ticks / TimeSpan.TicksPerMillisecond;
350-
timeOffset = (int) (mSecsNew - mSecsOld);
353+
timeOffset = (int)(mSecsNew - mSecsOld);
351354
}
352355
catch (FormatException)
353356
{
@@ -411,10 +414,7 @@ public Priority GetPriority(string fileName, IEnumerable<ILogLine> samples)
411414

412415
#region Private Methods
413416

414-
private string[] GetAllColumnNames()
415-
{
416-
return ["Timestamp", "Level", "Logger", "Thread", "Class", "Method", "File", "Line", "Message"];
417-
}
417+
private string[] GetAllColumnNames() => ["Timestamp", "Level", "Logger", "Thread", "Class", "Method", "File", "Line", "Message"];
418418

419419

420420
/// <summary>
@@ -442,7 +442,7 @@ private Column[] MapColumns(Column[] cols)
442442
}
443443

444444

445-
return output.ToArray();
445+
return [.. output];
446446
}
447447

448448
#endregion

src/Log4jXmlColumnizer/Log4jXmlColumnizerConfigDlg.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Drawing;
23
using System.Windows.Forms;
34

45
namespace LogExpert
@@ -15,10 +16,15 @@ public partial class Log4jXmlColumnizerConfigDlg : Form
1516

1617
public Log4jXmlColumnizerConfigDlg(Log4jXmlColumnizerConfig config)
1718
{
19+
SuspendLayout();
20+
AutoScaleDimensions = new SizeF(96F, 96F);
21+
AutoScaleMode = AutoScaleMode.Dpi;
22+
1823
_config = config;
1924
InitializeComponent();
2025
FillListBox();
2126
localTimeCheckBox.Checked = _config.localTimestamps;
27+
ResumeLayout();
2228
}
2329

2430
#endregion
@@ -33,7 +39,7 @@ private void FillListBox()
3339

3440
foreach (Log4jColumnEntry entry in _config.columnList)
3541
{
36-
DataGridViewRow row = new DataGridViewRow();
42+
DataGridViewRow row = new();
3743
row.Cells.Add(new DataGridViewCheckBoxCell());
3844
row.Cells.Add(new DataGridViewTextBoxCell());
3945
row.Cells.Add(new DataGridViewTextBoxCell());
@@ -58,8 +64,8 @@ private void OkButton_Click(object sender, EventArgs e)
5864
{
5965
_config.columnList[i].visible = (bool)columnGridView.Rows[i].Cells[0].Value;
6066
string sLen = (string)columnGridView.Rows[i].Cells[2].Value;
61-
int len;
62-
if (int.TryParse(sLen, out len))
67+
68+
if (int.TryParse(sLen, out int len))
6369
{
6470
_config.columnList[i].maxLen = len;
6571
}

0 commit comments

Comments
 (0)