mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-17 13:44:46 +00:00
Merge pull request #8 in PEC/pepperdash-simplsharp-core from feature/debug to master
* commit 'b94ebe082d099ef6cc0a4ec88b55c7571f898a17': Added timestamp to debug console messages Minor updates to tcp client
This commit is contained in:
@@ -307,7 +307,8 @@ namespace PepperDash.Core
|
||||
{
|
||||
//if (Debug.Level == 2)
|
||||
// Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
|
||||
Client.SendData(bytes, bytes.Length);
|
||||
if(Client != null)
|
||||
Client.SendData(bytes, bytes.Length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,11 +39,13 @@ namespace PepperDash.Core
|
||||
Key = key;
|
||||
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
|
||||
Name = "";
|
||||
|
||||
}
|
||||
|
||||
public Device(string key, string name) : this(key)
|
||||
{
|
||||
Name = name;
|
||||
|
||||
}
|
||||
|
||||
//public Device(DeviceConfig config)
|
||||
@@ -105,5 +107,6 @@ namespace PepperDash.Core
|
||||
{
|
||||
if (o is bool && !(bool)o) a();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ namespace PepperDash.Core
|
||||
public static void Console(uint level, string format, params object[] items)
|
||||
{
|
||||
if (Level >= level)
|
||||
CrestronConsole.PrintLine("App {0}:{1}", InitialParametersClass.ApplicationNumber,
|
||||
CrestronConsole.PrintLine("[{0}]App {1}:{2}", DateTime.Now.ToString("HH:mm:ss.fff"), InitialParametersClass.ApplicationNumber,
|
||||
string.Format(format, items));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user