Skip to content

Commit

Permalink
Merge pull request #21 from akesseler/xml-format
Browse files Browse the repository at this point in the history
Support of XML message format.
  • Loading branch information
akesseler authored Nov 21, 2019
2 parents a04fa2d + 067bb80 commit 20ffdf3
Show file tree
Hide file tree
Showing 69 changed files with 6,228 additions and 120 deletions.
2 changes: 1 addition & 1 deletion code/hlp/Plexdata.LogWriter.help.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<IndentHtml>False</IndentHtml>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpTitle>Plexdata Logging Writer</HelpTitle>
<HelpFileVersion>1.0.5.1</HelpFileVersion>
<HelpFileVersion>1.0.5.2</HelpFileVersion>
<NamingMethod>Guid</NamingMethod>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<RootNamespaceContainer>True</RootNamespaceContainer>
Expand Down
2 changes: 1 addition & 1 deletion code/hlp/Plexdata.LogWriter.wiki.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<IndentHtml>False</IndentHtml>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpTitle>Plexdata Logging Writer</HelpTitle>
<HelpFileVersion>1.0.5.1</HelpFileVersion>
<HelpFileVersion>1.0.5.2</HelpFileVersion>
<NamingMethod>Guid</NamingMethod>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<RootNamespaceContainer>True</RootNamespaceContainer>
Expand Down
10 changes: 10 additions & 0 deletions code/src/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@


**1.0.5.2**
- Support of a simple XML message format.
- Correction of some typos.
- Tests adjusted as well as new tests added.
- Testing application enriched by new feature and others.
- Source code and online documentation updated.
- Version number increased.
- Wiki and release update on _GitHub_.
- All affected packages released on `nuget.org`.

**1.0.5.1**
- Introduction of e-mail logger.
- Mail logger project added.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void LoggerFactory_CreateLogEventFormatterForDefaultType_FormatterTypeIsD
[TestCase(LogType.Raw, typeof(RawFormatter))]
[TestCase(LogType.Csv, typeof(CsvFormatter))]
[TestCase(LogType.Json, typeof(JsonFormatter))]
[TestCase(LogType.Xml, typeof(XmlFormatter))]
public void LoggerFactory_CreateLogEventFormatterForSpecialType_FormatterTypeAsExpected(LogType type, Type expected)
{
this.settings.LogType = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void Setup()
[Test]
[TestCase(LogType.Raw)]
[TestCase(LogType.Json)]
[TestCase(LogType.Xml)]
public void CsvFormatter_WrongLogType_ThrowsNotSupportedException(LogType logType)
{
this.settings.SetupGet(x => x.LogType).Returns(logType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void Setup()
[Test]
[TestCase(LogType.Csv)]
[TestCase(LogType.Raw)]
[TestCase(LogType.Xml)]
public void JsonFormatter_WrongLogType_ThrowsNotSupportedException(LogType logType)
{
this.settings.SetupGet(x => x.LogType).Returns(logType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void Setup()
[Test]
[TestCase(LogType.Csv)]
[TestCase(LogType.Json)]
[TestCase(LogType.Xml)]
public void RawFormatter_WrongLogType_ThrowsNotSupportedException(LogType logType)
{
this.settings.SetupGet(x => x.LogType).Returns(logType);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<Compile Include="Internals\Formatters\FormatterBaseTests.cs" />
<Compile Include="Internals\Formatters\JsonFormatterTests.cs" />
<Compile Include="Internals\Formatters\RawFormatterTests.cs" />
<Compile Include="Internals\Formatters\XmlFormatterTests.cs" />
<Compile Include="Internals\Settings\LoggerSettingsBaseTests.cs" />
<Compile Include="Internals\Settings\LoggerSettingsEmptyTests.cs" />
<Compile Include="Internals\Settings\LoggerSettingsJsonTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.1")]
[assembly: AssemblyFileVersion("1.0.5.1")]
[assembly: AssemblyVersion("1.0.5.2")]
[assembly: AssemblyFileVersion("1.0.5.2")]
10 changes: 8 additions & 2 deletions code/src/Plexdata.LogWriter.Abstraction/Definitions/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace Plexdata.LogWriter.Definitions
/// This enumeration defines all currently supported logging types.
/// </summary>
/// <remarks>
/// For the moment a raw-text logger, a CSV logger as well as a JSON
/// logger type are supported.
/// For the moment a raw-text logger, a CSV logger, a JSON as well
/// as an XML logger are the supported types.
/// </remarks>
public enum LogType
{
Expand All @@ -52,6 +52,12 @@ public enum LogType
/// </summary>
Json,

/// <summary>
/// Use XML output format. The output is formatted in Extensible
/// Markup Language format.
/// </summary>
Xml,

/// <summary>
/// Use default output format, which is set to <see cref="Raw"/>
/// format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public ILogEventFormatter CreateLogEventFormatter(ILoggerSettings settings)
return new JsonFormatter(settings);
case LogType.Csv:
return new CsvFormatter(settings);
case LogType.Xml:
return new XmlFormatter(settings);
default:
return new RawFormatter(settings);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected override String ToValue(String value, Char split)

/// <inheritdoc />
/// <remarks>
/// This method takes the value and check if it includes at least one double
/// This method takes the value and checks if it includes at least one double
/// quote character or one carriage return character or one line feed character
/// or one of the provided split character. If this the case then the whole
/// value is surrounded by double quotes. Additionally, each of the double
Expand Down Expand Up @@ -197,7 +197,7 @@ protected override String ToOutput(String label, String value, Char split)
/// The string builder to be used.
/// </param>
/// <param name="key">
/// The key stamp to be used.
/// The key to be used.
/// </param>
/// <param name="split">
/// The split character to be appended.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected override String ToValue(String value, Char split)
/// <inheritdoc />
/// <remarks>
/// <para>
/// This method takes the value and check if it includes at least one the
/// This method takes the value and checks if it includes at least one the
/// characters backslash, double quote, carriage return, line feed, form
/// feed, backspace or tab. If this is the case then each of those control
/// characters is escaped by a backslash. Additionally, each result string
Expand Down Expand Up @@ -231,7 +231,7 @@ protected override String ToOutput(String label, String value, Char split)
/// The value label to be used.
/// </param>
/// <param name="key">
/// The key stamp to be used.
/// The key to be used.
/// </param>
/// <param name="split">
/// The split character to be appended.
Expand Down Expand Up @@ -399,7 +399,7 @@ private void AddMessage(StringBuilder builder, String label, String message, Cha
/// </summary>
/// <remarks>
/// <para>
/// The details are always added and cannot be disabled, but might be empty.
/// The details are always added and cannot be disabled, but might be <c>empty</c>.
/// </para>
/// <para>
/// If a value list is available, then each of them is put into a string with
Expand Down
Loading

0 comments on commit 20ffdf3

Please sign in to comment.