-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development-2' into feature-2/ssh-updates
- Loading branch information
Showing
7 changed files
with
146 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Crestron.SimplSharp; | ||
using Serilog.Core; | ||
using Serilog.Events; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace PepperDash.Core.Logging | ||
{ | ||
public class CrestronEnricher : ILogEventEnricher | ||
{ | ||
static readonly string _appName; | ||
|
||
static CrestronEnricher() | ||
{ | ||
switch (CrestronEnvironment.DevicePlatform) | ||
{ | ||
case eDevicePlatform.Appliance: | ||
_appName = $"App {InitialParametersClass.ApplicationNumber}"; | ||
break; | ||
case eDevicePlatform.Server: | ||
_appName = $"{InitialParametersClass.RoomId}"; | ||
break; | ||
} | ||
} | ||
|
||
|
||
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) | ||
{ | ||
var property = propertyFactory.CreateProperty("App", _appName); | ||
|
||
logEvent.AddOrUpdateProperty(property); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.