Skip to content

Commit

Permalink
Add XML documentation file to build output and NuGet package (#97 closes
Browse files Browse the repository at this point in the history
 #96)
  • Loading branch information
luigiberrettini authored Jul 22, 2017
1 parent 06c25e2 commit 8bc28f4
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/NLog.Targets.Syslog/AsyncLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public AsyncLogger(Layout loggingLayout, EnforcementConfig enforcementConfig, Me

public void Log(AsyncLogEventInfo asyncLogEvent)
{
throttling.Apply(queue.Count, delay => Enqueue(asyncLogEvent, delay));
throttling.Apply(queue.Count, timeout => Enqueue(asyncLogEvent, timeout));
}

private BlockingCollection<AsyncLogEventInfo> NewBlockingCollection()
Expand Down Expand Up @@ -98,9 +98,9 @@ private Task ProcessQueueAsync(MessageBuilder messageBuilder, TaskCompletionSour
}
}

private void Enqueue(AsyncLogEventInfo asyncLogEventInfo, int delay)
private void Enqueue(AsyncLogEventInfo asyncLogEventInfo, int timeout)
{
queue.TryAdd(asyncLogEventInfo, delay, token);
queue.TryAdd(asyncLogEventInfo, timeout, token);
InternalLogger.Debug(() => $"Enqueued '{asyncLogEventInfo.ToFormattedMessage()}'");
}

Expand Down
4 changes: 3 additions & 1 deletion src/NLog.Targets.Syslog/NLog.Targets.Syslog.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<DocumentationFile>bin\Debug\NLog.Targets.Syslog.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
Expand All @@ -35,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>bin\Release\NLog.Targets.Syslog.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Targets.Syslog/NLog.Targets.Syslog.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:nlog="http://www.nlog-project.org/schemas/NLog.xsd">
<xs:import namespace="http://www.nlog-project.org/schemas/NLog.xsd" />
<xs:annotation>
<xs:documentation>NLog Syslog target schema for Intellisense™ 4.0.0</xs:documentation>
<xs:documentation>NLog Syslog target schema for Intellisense™ 4.0.1</xs:documentation>
</xs:annotation>
<xs:complexType name="Syslog">
<xs:complexContent>
Expand Down
4 changes: 2 additions & 2 deletions src/NLog.Targets.Syslog/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyCopyright("Copyright © 2013 - present by Jesper Hess Nielsen, Luigi Berrettini and others: https://github.com/graffen/NLog.Targets.Syslog/graphs/contributors")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0")]
[assembly: AssemblyFileVersion("4.0.1.0")]
[assembly: AssemblyInformationalVersion("4.0.1")]
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/EnforcementConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public EnforcementConfig()
messageProcessors = 1;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
throttling.PropertyChanged -= throttlingPropsChanged;
Expand Down
3 changes: 3 additions & 0 deletions src/NLog.Targets.Syslog/Settings/FramingMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace NLog.Targets.Syslog.Settings
/// <summary>The framing method to be used when transmitting a message</summary>
public enum FramingMethod
{
/// <summary>NonTransparent framing</summary>
NonTransparent,

/// <summary>OctetCounting framing</summary>
OctetCounting
}
}
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/KeepAliveConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public int Interval
set { SetProperty(ref interval, value); }
}

/// <summary>Builds a new instance of the KeepAliveConfig class</summary>
public KeepAliveConfig()
{
enabled = true;
Expand Down
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/MessageBuilderConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public MessageBuilderConfig()
rfc5424.PropertyChanged += rfc5424PropsChanged;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
rfc3164.PropertyChanged -= rfc3164PropsChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public MessageTransmitterConfig()
tcp.PropertyChanged += tcpPropsChanged;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
udp.PropertyChanged -= udpPropsChanged;
Expand Down
3 changes: 3 additions & 0 deletions src/NLog.Targets.Syslog/Settings/NotifyPropertyChanged.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public abstract class NotifyPropertyChanged : INotifyPropertyChanged
/// <summary>Multicast event for property change notifications</summary>
public event PropertyChangedEventHandler PropertyChanged;

/// <summary>Sets a property invoking PropertyChanged event handlers</summary>
protected bool SetProperty<T>(ref T oldValue, T newValue, [CallerMemberName] string propertyName = null)
{
if (Equals(oldValue, newValue))
Expand All @@ -22,11 +23,13 @@ protected bool SetProperty<T>(ref T oldValue, T newValue, [CallerMemberName] str
return true;
}

/// <summary>Invokes the handlers of the PropertyChanged event</summary>
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

/// <summary>Creates a collection changed event handler that manages the PropertyChanged event handler for colleciton items</summary>
protected NotifyCollectionChangedEventHandler CollectionChangedFactory(PropertyChangedEventHandler onElemPropsChanged)
{
return (sender, eventArgs) =>
Expand Down
3 changes: 3 additions & 0 deletions src/NLog.Targets.Syslog/Settings/ProtocolType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace NLog.Targets.Syslog.Settings
/// <summary>The protocol to be used when transmitting a message</summary>
public enum ProtocolType
{
/// <summary>UDP protocol</summary>
Udp,

/// <summary>TCP protocol</summary>
Tcp
}
}
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/Rfc5424Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public Rfc5424Config()
disableBom = false;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
structuredData.PropertyChanged -= structuredDataPropsChanged;
Expand Down
3 changes: 3 additions & 0 deletions src/NLog.Targets.Syslog/Settings/RfcNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace NLog.Targets.Syslog.Settings
/// <summary>The Syslog protocol RFC to be followed</summary>
public enum RfcNumber
{
/// <summary>RFC 3164</summary>
Rfc3164 = 3164,

/// <summary>RFC 5424</summary>
Rfc5424 = 5424
}
}
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/SdElementConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public SdElementConfig()
sdParams.CollectionChanged += sdParamsCollectionChanged;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
sdParams.ForEach(x => x.PropertyChanged -= sdParamPropsChanged);
Expand Down
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/StructuredDataConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public StructuredDataConfig()
sdElements.CollectionChanged += sdElementsCollectionChanged;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
sdElements.ForEach(x =>
Expand Down
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/Settings/TcpConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public TcpConfig()
dataChunkSize = DefaultBufferSize;
}

/// <summary>Disposes the instance</summary>
public void Dispose()
{
keepAlive.PropertyChanged -= keepAlivePropsChanged;
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.Targets.Syslog/Settings/ThrottlingConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public int Limit
}
}

/// <summary>The throttling strategy to employ</summary>
/// <summary>The throttling strategy to apply to incoming log entries</summary>
public ThrottlingStrategy Strategy
{
get { return strategy; }
Expand Down
13 changes: 13 additions & 0 deletions src/NLog.Targets.Syslog/Settings/ThrottlingStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@ namespace NLog.Targets.Syslog.Settings
/// <summary>The throttling strategy to be used</summary>
public enum ThrottlingStrategy
{
/// <summary>No throttling strategy</summary>
None,

/// <summary>Discard after a fixed timeout</summary>
DiscardOnFixedTimeout,

/// <summary>Discard after a timeout percentage of the log entries waiting to be processed</summary>
DiscardOnPercentageTimeout,

/// <summary>Discard log entries</summary>
Discard,

/// <summary>Defer for a fixed time</summary>
DeferForFixedTime,

/// <summary>Defer for a time percentage of the log entries waiting to be processed</summary>
DeferForPercentageTime,

/// <summary>Block indefinitely until waiting log entries decrease</summary>
Block
}
}
2 changes: 2 additions & 0 deletions src/NLog.Targets.Syslog/Settings/TlsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace NLog.Targets.Syslog.Settings
{
/// <summary>TLS configuration</summary>
public class TlsConfig : NotifyPropertyChanged
{
private bool enabled;
Expand Down Expand Up @@ -58,6 +59,7 @@ public string CertificateFilterValue
set { SetProperty(ref certificateFilterValue, value); }
}

/// <summary>Builds a new instance of the TlsConfig class</summary>
public TlsConfig()
{
enabled = false;
Expand Down
1 change: 1 addition & 0 deletions src/NLog.Targets.Syslog/SyslogTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ protected override void Write(AsyncLogEventInfo asyncLogEvent)
asyncLoggers[asyncLoggerId].Log(asyncLogEvent);
}

/// <summary>Disposes the instance</summary>
protected override void Dispose(bool disposing)
{
if (disposing)
Expand Down

0 comments on commit 8bc28f4

Please sign in to comment.