A collection of sinks, enrichers, and extensions used to create structured logging on Crestron Automation Platform for Audio And Video integration.
It provides the following sinks:
- CrestronSystemConsole. Writes Logs to Crestron Console.
- CrestronErrorLog. Writes Logs to Crestron Permanent Error Log.
The Following Enrichers
- SlotNo. Injects a property containing the Slot Id or the Room Id of the running application.
- ProgramName. Injects a property containing the Program Name of the running application.
The Following Extensions:
- FromHere. Extension that provide three ForContext Properties:
- FileName: Log event property that contains the running code internal File Name.
- MemberName: Log event property that contains the running code Member Name (Executing Method)
- LineNumber: Log event property that contains the running code internal Line Number.
Logger configuration can easily be achieved by using Serilog Configuration packages:
- Serilog.Settings.AppSettings for XML Configurations
- Serilog.Settings.Configuration for JSON Configurations
These packages were designed for regular .NET applications (Microsoft Console, WinForms, etc), so a couple of adjustments are needed to work under Crestron.
There is a SIMPL# Pro project under the sample Directory that you can reference. You can also download the compiled project (CrestronLoggingDemo.cpz) and push into a 4-series processor or VC4.
See Contributing.md
The MSBUILD on this project has been converted to SDK, to simplify package maintenance. This project borrows the code for its CrestronConsole from Serilog.Sinks.Console
Copyright © All Contributers - Provided under the Apache License, Version 2.0.