mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 13:14:49 +00:00
Changed most debugging to add log ability. Program will not run. Type load exception
This commit is contained in:
Binary file not shown.
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronDataStore;
|
using Crestron.SimplSharp.CrestronLogger;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core.DebugThings;
|
using PepperDash.Core.DebugThings;
|
||||||
@@ -41,12 +41,20 @@ namespace PepperDash.Core
|
|||||||
CrestronConsole.AddNewConsoleCommand(SetDebugFromConsole, "appdebug",
|
CrestronConsole.AddNewConsoleCommand(SetDebugFromConsole, "appdebug",
|
||||||
"appdebug:P [0-2]: Sets the application's console debug message level",
|
"appdebug:P [0-2]: Sets the application's console debug message level",
|
||||||
ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
CrestronConsole.AddNewConsoleCommand(ShowDebugLog, "appdebuglog",
|
||||||
|
"appdebuglog:P [all] Dumps the custom log. Use \"all\" to show full log, otherwise last-200 entries are returned.",
|
||||||
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
CrestronConsole.AddNewConsoleCommand(s => CrestronLogger.Clear(false), "appdebugclear",
|
||||||
|
"appdebugclear:P Clears the current custom log. Does not clear backup logs",
|
||||||
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
||||||
|
|
||||||
LoadMemory();
|
LoadMemory();
|
||||||
Level = Contexts.GetOrCreateItem("DEFAULT").Level;
|
Level = Contexts.GetOrCreateItem("DEFAULT").Level;
|
||||||
|
|
||||||
|
CrestronLogger.Initialize(2, LoggerModeEnum.RM); // Use RM instead of DEFAULT as not to double-up console messages.
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -110,6 +118,16 @@ namespace PepperDash.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static void ShowDebugLog(string s)
|
||||||
|
{
|
||||||
|
var loglist = CrestronLogger.PrintTheLog(s.ToLower() == "all");
|
||||||
|
foreach (var l in loglist)
|
||||||
|
CrestronConsole.ConsoleCommandResponse(l);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints message to console if current debug level is equal to or higher than the level of this message.
|
/// Prints message to console if current debug level is equal to or higher than the level of this message.
|
||||||
/// Uses CrestronConsole.PrintLine.
|
/// Uses CrestronConsole.PrintLine.
|
||||||
@@ -155,6 +173,43 @@ namespace PepperDash.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at
|
||||||
|
/// or above the level provided, then the output will be written to both console and the log. Otherwise
|
||||||
|
/// it will only be written to the log.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="format"></param>
|
||||||
|
/// <param name="items"></param>
|
||||||
|
public static void ConsoleWithLog(uint level, string format, params object[] items)
|
||||||
|
{
|
||||||
|
var str = string.Format(format, items);
|
||||||
|
if (Level >= level)
|
||||||
|
CrestronConsole.PrintLine("App {0}:{1}", InitialParametersClass.ApplicationNumber, str);
|
||||||
|
CrestronLogger.WriteToLog(str, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at
|
||||||
|
/// or above the level provided, then the output will be written to both console and the log. Otherwise
|
||||||
|
/// it will only be written to the log.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="dev"></param>
|
||||||
|
/// <param name="format">String.format string</param>
|
||||||
|
/// <param name="items">Parameters for substitution in the format string.</param>
|
||||||
|
public static void ConsoleWithLog(uint level, IKeyed dev, string format, params object[] items)
|
||||||
|
{
|
||||||
|
var str = string.Format(format, items);
|
||||||
|
if (Level >= level)
|
||||||
|
ConsoleWithLog(level, "[{0}] {1}", dev.Key, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Prints to log and error log
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="errorLogLevel"></param>
|
||||||
|
/// <param name="str"></param>
|
||||||
public static void LogError(ErrorLogLevel errorLogLevel, string str)
|
public static void LogError(ErrorLogLevel errorLogLevel, string str)
|
||||||
{
|
{
|
||||||
string msg = string.Format("App {0}:{1}", InitialParametersClass.ApplicationNumber, str);
|
string msg = string.Format("App {0}:{1}", InitialParametersClass.ApplicationNumber, str);
|
||||||
@@ -241,6 +296,4 @@ namespace PepperDash.Core
|
|||||||
Error, Warning, Notice, None
|
Error, Warning, Notice, None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
3/21/2017 1:09:34 PM, Info: Initializing SIMPLSharp Services...
|
||||||
|
3/21/2017 1:09:34 PM, Info: ProjectInfo successfully initialized.
|
||||||
|
3/21/2017 1:09:59 PM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll...
|
||||||
|
3/21/2017 1:09:59 PM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||||
|
3/21/2017 1:10:00 PM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.clz...
|
||||||
|
3/21/2017 1:10:00 PM, Info: Saving project information...
|
||||||
|
3/21/2017 1:14:17 PM, Info: Terminating SIMPLSharp Services
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
3/30/2017 10:52:00 AM, Info: Initializing SIMPLSharp Services...
|
||||||
|
3/30/2017 10:52:00 AM, Info: ProjectInfo successfully initialized.
|
||||||
|
3/30/2017 11:31:42 AM, Info: Terminating SIMPLSharp Services
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
4/27/2017 2:27:13 PM, Info: Initializing SIMPLSharp Services...
|
||||||
|
4/27/2017 2:27:13 PM, Info: ProjectInfo successfully initialized.
|
||||||
|
4/27/2017 2:47:36 PM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll...
|
||||||
|
4/27/2017 2:47:37 PM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||||
|
4/27/2017 2:47:37 PM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.clz...
|
||||||
|
4/27/2017 2:47:38 PM, Info: Saving project information...
|
||||||
|
4/27/2017 2:51:45 PM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll...
|
||||||
|
4/27/2017 2:51:45 PM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||||
|
4/27/2017 2:51:45 PM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.clz...
|
||||||
|
4/27/2017 2:51:45 PM, Info: Saving project information...
|
||||||
|
4/27/2017 2:54:30 PM, Info: Terminating SIMPLSharp Services
|
||||||
Binary file not shown.
@@ -10,8 +10,8 @@
|
|||||||
<ArchiveName />
|
<ArchiveName />
|
||||||
</RequiredInfo>
|
</RequiredInfo>
|
||||||
<OptionalInfo>
|
<OptionalInfo>
|
||||||
<CompiledOn>3/21/2017 1:09:59 PM</CompiledOn>
|
<CompiledOn>4/27/2017 3:03:20 PM</CompiledOn>
|
||||||
<CompilerRev>1.0.6289.21898</CompilerRev>
|
<CompilerRev>1.0.6326.25299</CompilerRev>
|
||||||
</OptionalInfo>
|
</OptionalInfo>
|
||||||
<Plugin>
|
<Plugin>
|
||||||
<Version>Crestron.SIMPLSharp, Version=2.0.48.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>
|
<Version>Crestron.SIMPLSharp, Version=2.0.48.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
MainAssembly=PepperDash_Core.dll:00d1b9d87735985f4fbe4cd55c2b5400
|
MainAssembly=PepperDash_Core.dll:0530e92ffa26ff73039f7720af6e8148
|
||||||
MainAssemblyMinFirmwareVersion=1.007.0017
|
MainAssemblyMinFirmwareVersion=1.007.0017
|
||||||
MainAssemblyResource=SimplSharpData.dat:315526abf906cded47fb0c7510266a7e
|
MainAssemblyResource=SimplSharpData.dat:820b61c48c8a2cace82957eed4cc377c
|
||||||
ü
|
ü
|
||||||
DependencySource=Newtonsoft.Json.Compact.dll:ea996aa2ec65aa1878e7c9d09e37a896
|
DependencySource=Newtonsoft.Json.Compact.dll:ea996aa2ec65aa1878e7c9d09e37a896
|
||||||
DependencyPath=PepperDash_Core.clz:Newtonsoft.Json.Compact.dll
|
DependencyPath=PepperDash_Core.clz:Newtonsoft.Json.Compact.dll
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,16 +8,6 @@ C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepper
|
|||||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
||||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
||||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpCustomAttributesInterface.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpHelperInterface.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpNewtonsoft.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpSQLHelperInterface.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpReflectionInterface.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
|
||||||
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
|
||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpCustomAttributesInterface.dll
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpCustomAttributesInterface.dll
|
||||||
@@ -28,3 +18,13 @@ C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\Si
|
|||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
||||||
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
C:\P\BitBucket\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpCustomAttributesInterface.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpHelperInterface.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpNewtonsoft.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpSQLHelperInterface.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpReflectionInterface.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
||||||
|
C:\Users\hvolmer\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user