Skip to content

Commit 7210978

Browse files
authored
Add Syslog ILogger provider (#86)
1 parent 1b6e418 commit 7210978

File tree

12 files changed

+673
-1
lines changed

12 files changed

+673
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
| nanoFramework.Logging.Serial (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoframework.Logging/_apis/build/status/nanoframework.nanoFramework.Logging?branchName=develop)](https://dev.azure.com/nanoframework/nanoframework.Logging/_build/latest?definitionId=71&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Logging.Serial.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Logging.Serial/) |
1717
| nanoFramework.Logging.Stream | [![Build Status](https://dev.azure.com/nanoframework/nanoframework.Logging/_apis/build/status/nanoframework.nanoFramework.Logging?branchName=main)](https://dev.azure.com/nanoframework/nanoframework.Logging/_build/latest?definitionId=71&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Logging.Stream.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Logging.Stream/) |
1818
| nanoFramework.Logging.Stream (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoframework.Logging/_apis/build/status/nanoframework.nanoFramework.Logging?branchName=develop)](https://dev.azure.com/nanoframework/nanoframework.Logging/_build/latest?definitionId=71&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Logging.Stream.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Logging.Stream/) |
19+
| nanoFramework.Logging.Syslog | [![Build Status](https://dev.azure.com/nanoframework/nanoframework.Logging/_apis/build/status/nanoframework.nanoFramework.Logging?branchName=main)](https://dev.azure.com/nanoframework/nanoframework.Logging/_build/latest?definitionId=71&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/nanoFramework.Logging.Syslog.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Logging.Syslog/) |
20+
| nanoFramework.Logging.Syslog (preview) | [![Build Status](https://dev.azure.com/nanoframework/nanoframework.Logging/_apis/build/status/nanoframework.nanoFramework.Logging?branchName=develop)](https://dev.azure.com/nanoframework/nanoframework.Logging/_build/latest?definitionId=71&branchName=develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Logging.Syslog.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.Logging.Syslog/) |
1921

2022

2123
## Feedback and documentation
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>nanoFramework.Logging.Syslog</id>
5+
<version>$version$</version>
6+
<title>nanoFramework.Logging.Syslog</title>
7+
<authors>nanoFramework project contributors</authors>
8+
<owners>nanoFramework,dotnetfoundation</owners>
9+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
10+
<license type="file">LICENSE.md</license>
11+
<releaseNotes>
12+
</releaseNotes>
13+
<readme>docs\README.md</readme>
14+
<developmentDependency>false</developmentDependency>
15+
<projectUrl>https://github.com/nanoframework/nanoFramework.Logging</projectUrl>
16+
<icon>images\nf-logo.png</icon>
17+
<repository type="git" url="https://github.com/nanoframework/nanoFramework.Logging" commit="$commit$" />
18+
<copyright>Copyright (c) .NET Foundation and Contributors</copyright>
19+
<description>This package includes the nanoFramework.Logging.Syslog assembly (Syslog Logging only) for .NET nanoFramework C# projects.
20+
There is also a package with the Serial Logging, another with Stream Logging only and another with the basic Debug Logging.</description>
21+
<tags>nanoFramework C# csharp netmf netnf nanoFramework.Logging.Syslog</tags>
22+
<dependencies>
23+
<dependency id="nanoFramework.CoreLibrary" version="1.12.0-preview.1" />
24+
<dependency id="nanoFramework.Runtime.Events" version="1.10.0-preview.4" />
25+
<dependency id="nanoFramework.System.Text" version="1.1.3-preview.7" />
26+
<dependency id="nanoFramework.System.Net" version="1.8.0-preview.15" />
27+
<dependency id="nanoFramework.System.Threading" version="1.0.4-preview.8" />
28+
<dependency id="nanoFramework.Logging" version="$version$" />
29+
</dependencies>
30+
</metadata>
31+
<files>
32+
<file src="nanoFramework.Logging.Syslog\bin\Release\nanoFramework.Logging.Syslog.dll" target="lib\nanoFramework.Logging.Syslog.dll" />
33+
<file src="nanoFramework.Logging.Syslog\bin\Release\nanoFramework.Logging.Syslog.pdb" target="lib\nanoFramework.Logging.Syslog.pdb" />
34+
<file src="nanoFramework.Logging.Syslog\bin\Release\nanoFramework.Logging.Syslog.pdbx" target="lib\nanoFramework.Logging.Syslog.pdbx" />
35+
<file src="nanoFramework.Logging.Syslog\bin\Release\nanoFramework.Logging.Syslog.pe" target="lib\nanoFramework.Logging.Syslog.pe" />
36+
<file src="nanoFramework.Logging.Syslog\bin\Release\nanoFramework.Logging.Syslog.xml" target="lib\nanoFramework.Logging.Syslog.xml" />
37+
<file src="assets\readme.txt" target="" />
38+
<file src="README.md" target="docs\" />
39+
<file src="assets\nf-logo.png" target="images" />
40+
<file src="LICENSE.md" target="" />
41+
</files>
42+
</package>
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
//
5+
6+
namespace nanoFramework.Logging.Syslog
7+
{
8+
/// <summary>
9+
/// Available facility types (RFC 3164).
10+
/// </summary>
11+
public enum Facility
12+
{
13+
/// <summary>
14+
/// kernel messages
15+
/// </summary>
16+
Kern = 0,
17+
/// <summary>
18+
/// user-level messages
19+
/// </summary>
20+
User = 1,
21+
/// <summary>
22+
/// mail system
23+
/// </summary>
24+
Mail = 2,
25+
/// <summary>
26+
/// system daemons
27+
/// </summary>
28+
Daemon = 3,
29+
/// <summary>
30+
/// security/authorization messages
31+
/// </summary>
32+
Auth = 4,
33+
/// <summary>
34+
/// messages generated internally by syslogd
35+
/// </summary>
36+
Syslog = 5,
37+
/// <summary>
38+
/// line printer subsystem
39+
/// </summary>
40+
LPR = 6,
41+
/// <summary>
42+
/// network news subsystem
43+
/// </summary>
44+
News = 7,
45+
/// <summary>
46+
/// UUCP subsystem
47+
/// </summary>
48+
UUCP = 8,
49+
/// <summary>
50+
/// clock daemon
51+
/// </summary>
52+
Cron = 9,
53+
/// <summary>
54+
/// security/authorization messages
55+
/// </summary>
56+
AuthPriv = 10,
57+
/// <summary>
58+
/// FTP daemon
59+
/// </summary>
60+
FTP = 11,
61+
/// <summary>
62+
/// NTP subsystem
63+
/// </summary>
64+
NTP = 12,
65+
/// <summary>
66+
/// log audit
67+
/// </summary>
68+
Audit = 13,
69+
/// <summary>
70+
/// log alert
71+
/// </summary>
72+
Audit2 = 14,
73+
/// <summary>
74+
/// clock daemon
75+
/// </summary>
76+
Cron2 = 15,
77+
/// <summary>
78+
/// local use 0 (local0)
79+
/// </summary>
80+
Local0 = 16,
81+
/// <summary>
82+
/// local use 1 (local1)
83+
/// </summary>
84+
Local1 = 17,
85+
/// <summary>
86+
/// local use 2 (local2)
87+
/// </summary>
88+
Local2 = 18,
89+
/// <summary>
90+
/// local use 3 (local3)
91+
/// </summary>
92+
Local3 = 19,
93+
/// <summary>
94+
/// local use 4 (local4)
95+
/// </summary>
96+
Local4 = 20,
97+
/// <summary>
98+
/// local use 5 (local5)
99+
/// </summary>
100+
Local5 = 21,
101+
/// <summary>
102+
/// local use 6 (local6)
103+
/// </summary>
104+
Local6 = 22,
105+
/// <summary>
106+
/// local use 7 (local7)
107+
/// </summary>
108+
Local7 = 23
109+
}
110+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("nanoFramework.Logging")]
9+
[assembly: AssemblyCompany("nanoFramework Contributors")]
10+
[assembly: AssemblyProduct("nanoFramework.Logging")]
11+
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
/////////////////////////////////////////////////////////////////
19+
// This attribute is mandatory when building Interop libraries //
20+
// update this whenever the native assembly signature changes //
21+
[assembly: AssemblyNativeVersion("1.0.0.0")]
22+
/////////////////////////////////////////////////////////////////
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
//
5+
6+
using Microsoft.Extensions.Logging;
7+
8+
namespace nanoFramework.Logging.Syslog
9+
{
10+
/// <summary>
11+
/// Severity represents the Severity in the Syslog messages. This corresponds to the values defined in RFC 3164 except None which means that the message won't be sent.
12+
/// </summary>
13+
public enum Severity
14+
{
15+
/// <summary>
16+
/// Not an official RFC3164 facility. No entry will be generated when called with this Severity
17+
/// </summary>
18+
None = -1,
19+
/// <summary>
20+
/// Emergency: system is unusable. No equivalent in <see cref="LogLevel"/>
21+
/// </summary>
22+
Emergency,
23+
/// <summary>
24+
/// Alert: action must be taken immediately. No equivalent in <see cref="LogLevel"/>
25+
/// </summary>
26+
Alert,
27+
/// <summary>
28+
/// Critical: critical conditions. Mapped to <see cref="LogLevel.Critical"/>
29+
/// </summary>
30+
Critical,
31+
/// <summary>
32+
/// Error: error conditions. Mapped to <see cref="LogLevel.Error"/>
33+
/// </summary>
34+
Error,
35+
/// <summary>
36+
/// Warning: warning conditions. Mapped to <see cref="LogLevel.Warning"/>
37+
/// </summary>
38+
Warning,
39+
/// <summary>
40+
/// Notice: normal but significant condition. No equivalent in <see cref="LogLevel"/>
41+
/// </summary>
42+
Notice,
43+
/// <summary>
44+
/// Informational: informational messages. Mapped to <see cref="LogLevel.Information"/>
45+
/// </summary>
46+
Informational,
47+
/// <summary>
48+
/// Debug: debug-level messages. Mapped to <see cref="LogLevel.Debug"/> and <see cref="LogLevel.Trace"/>
49+
/// </summary>
50+
Debug
51+
};
52+
}

0 commit comments

Comments
 (0)