42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
namespace Common.Hardware.SIRT
|
|
{
|
|
using System;
|
|
|
|
public static class SIRTLogger
|
|
{
|
|
public static event Action<string> Message;
|
|
public static event Action<string> RawData;
|
|
public static event Action<string> State;
|
|
|
|
internal static void LogMessage(object message)
|
|
{
|
|
var messageEvent = Message;
|
|
|
|
if (messageEvent != null)
|
|
{
|
|
messageEvent($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fffffff}|{message}");
|
|
}
|
|
}
|
|
|
|
internal static void LogRawData(object data)
|
|
{
|
|
var rawDataEvent = RawData;
|
|
|
|
if (rawDataEvent != null)
|
|
{
|
|
rawDataEvent($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fffffff}|{data}");
|
|
}
|
|
}
|
|
|
|
internal static void LogState(object state)
|
|
{
|
|
var stateEvent = State;
|
|
|
|
if (stateEvent != null)
|
|
{
|
|
stateEvent($"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fffffff}|{state}");
|
|
}
|
|
}
|
|
}
|
|
}
|