public Log ( string name, string val, MessagePriority priority = MessagePriority.Low ) : void | ||
name | string | |
val | string | |
priority | MessagePriority | |
return | void |
public override void Log(string name, string val, MessagePriority priority = MessagePriority.Low)
{
lock (Sync)
{
try
{
ReportSystemInfo();
}
catch (Exception exc)
{
Log(exc);
}
if (_messages.Count >= MaxMessagesCount)
{
_messages.RemoveAll(message => message.Priority == MessagePriority.Low);
AddMessage(WarningName, "Message queue overflow. Some messages are skipped.", MessagePriority.High);
if (_messages.Count >= MaxMessagesCount) // too much high-priority messages
{
_messages.Clear();
AddMessage(ErrorName, "Critical message queue overflow. All messages are removed.", MessagePriority.High);
}
}
AddMessage(name, val, priority);
}
}
public static void ReportNodeInfo(Tracker tracker) { tracker.Log("Info_UserId", PluginSettings.Instance.UserId); tracker.Log("Info_NodeName", PluginSettings.Instance.NodeName); var curAssembly = typeof(Program).Assembly; tracker.Log("Info_ProcessVersion", curAssembly.FullName); var res = string.Format("v{0}", typeof(CIAPI.Rpc.Client).Assembly.GetName().Version); tracker.Log("Info_CiapiVersion", res); }