1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed debug log removing wrong line at >50 lines

Wrapped LUA loading in try-catch
This commit is contained in:
SpoinkyNL 2016-11-12 19:42:08 +01:00
parent c172ec4c6a
commit c9481d4442
3 changed files with 15 additions and 9 deletions

View File

@ -16,8 +16,8 @@
<!--<GridViewColumn DisplayMemberBinding="{Binding LoggerName}" Header="Logger"/>-->
<GridViewColumn DisplayMemberBinding="{Binding Level}" Header="Level" />
<GridViewColumn DisplayMemberBinding="{Binding TimeStamp, StringFormat=HH:mm:ss.ffffff}" Header="Time" />
<GridViewColumn DisplayMemberBinding="{Binding FormattedMessage}" Width="600" Header="Message" />
<GridViewColumn DisplayMemberBinding="{Binding Exception}" Width="Auto" Header="Exception" />
<GridViewColumn DisplayMemberBinding="{Binding FormattedMessage}" Width="500" Header="Message" />
<GridViewColumn DisplayMemberBinding="{Binding Exception.Message}" Width="300" Header="Exception" />
</GridView.Columns>
</GridView>
</ListView.View>

View File

@ -28,7 +28,7 @@ namespace Artemis.Controls.Log
await Dispatcher.InvokeAsync(() =>
{
if (LogCollection.Count >= 50)
LogCollection.RemoveAt(LogCollection.Count - 1);
LogCollection.RemoveAt(0);
LogCollection.Add(message);
});

View File

@ -97,12 +97,18 @@ namespace Artemis.Profiles.Lua
LuaKeyboardWrapper?.Dispose();
LuaKeyboardWrapper = null;
LuaScript.Globals.Clear();
LuaScript.Registry.Clear();
LuaScript.Registry.RegisterConstants();
LuaScript.Registry.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
LuaScript.Globals.RegisterConstants();
LuaScript.Globals.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
try
{
LuaScript.Registry.RegisterConstants();
LuaScript.Registry.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
LuaScript.Globals.RegisterConstants();
LuaScript.Globals.RegisterCoreModules(CoreModules.Preset_SoftSandbox);
}
catch (NullReferenceException)
{
// Can be missing if the user script screwed up the globals
}
}
}