mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 13:14:49 +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)
|
//if (Debug.Level == 2)
|
||||||
// Debug.Console(2, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes));
|
// 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;
|
Key = key;
|
||||||
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
|
if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
|
||||||
Name = "";
|
Name = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Device(string key, string name) : this(key)
|
public Device(string key, string name) : this(key)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public Device(DeviceConfig config)
|
//public Device(DeviceConfig config)
|
||||||
@@ -105,5 +107,6 @@ namespace PepperDash.Core
|
|||||||
{
|
{
|
||||||
if (o is bool && !(bool)o) a();
|
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)
|
public static void Console(uint level, string format, params object[] items)
|
||||||
{
|
{
|
||||||
if (Level >= level)
|
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));
|
string.Format(format, items));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user