mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
- Updated RelayControlledShade to utilize Timer for output pulsing. - Refactored MockVC to replace CTimer with Timer for call status simulation. - Modified VideoCodecBase to enhance documentation and improve feedback handling. - Removed obsolete IHasCamerasMessenger and updated related classes to use IHasCamerasWithControls. - Adjusted PressAndHoldHandler to implement Timer for button hold actions. - Enhanced logging throughout MobileControl and RoomBridges for better debugging and information tracking. - Cleaned up unnecessary comments and improved exception handling in various classes.
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
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;
|
|
|
|
/// <summary>
|
|
/// Enriches log events with Crestron-specific context properties, such as the application name based on the device platform.
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Enriches the log event with Crestron-specific properties.
|
|
/// </summary>
|
|
/// <param name="logEvent"></param>
|
|
/// <param name="propertyFactory"></param>
|
|
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
|
|
{
|
|
var property = propertyFactory.CreateProperty("App", _appName);
|
|
|
|
logEvent.AddOrUpdateProperty(property);
|
|
}
|
|
}
|