Got it working, but it’s a bet messed up.
In the start method, added this code:
Log.Level = (int)LogLevel.Error;
Log.LogMessage += l => { Debug.WriteLine(l.Level + ":) " + l.Message); };
Then to log something, here’s an example
Urho.IO.Log.Write(LogLevel.Error, "This is the start finished message using urho logging via handler");
This will output
[Fri Jan 25 15:00:25 2019] WARNING: This is the start finished message using urho logging via handler
To show how messed up it is, wrote this code:
Log.Level = (int)LogLevel.Debug;
Urho.IO.Log.Write(LogLevel.Raw, "Set to debug. This is the the raw message");
Urho.IO.Log.Write(LogLevel.Debug, "This is the debug message");
Urho.IO.Log.Write(LogLevel.Info, "This is the info message");
Urho.IO.Log.Write(LogLevel.Warning, "This is the warning message");
Urho.IO.Log.Write(LogLevel.Error, "This is the error message");
Urho.IO.Log.Write(LogLevel.None, "This is the none message");
Log.Level = (int)LogLevel.None;
Urho.IO.Log.Write(LogLevel.Raw, "Set to none. This is the the raw message");
Urho.IO.Log.Write(LogLevel.Debug, "This is the debug message");
Urho.IO.Log.Write(LogLevel.Info, "This is the info message");
Urho.IO.Log.Write(LogLevel.Warning, "This is the warning message");
Urho.IO.Log.Write(LogLevel.Error, "This is the error message");
Urho.IO.Log.Write(LogLevel.None, "This is the none message");
Which outputs this:
2:) Set to debug. This is the the raw message
0:) [Fri Jan 25 15:15:06 2019] TRACE: This is the debug message
1:) [Fri Jan 25 15:15:06 2019] DEBUG: This is the info message
2:) [Fri Jan 25 15:15:06 2019] INFO: This is the warning message
3:) [Fri Jan 25 15:15:06 2019] WARNING: This is the error message
This is the none message. You can omit this exception by subscribing to Urho.Application.UnhandledException event and set Handled property to True.
ApplicationOptions: args -w -nolimit -x 1268 -y 720 -p "CoreData;Data" -touch -hd -landscape -portrait :Error
4:) [Fri Jan 25 15:15:06 2019] ERROR: This is the none message
2:) Set to none. This is the the raw message
This is the none message. You can omit this exception by subscribing to Urho.Application.UnhandledException event and set Handled property to True.
ApplicationOptions: args -w -nolimit -x 1268 -y 720 -p "CoreData;Data" -touch -hd -landscape -portrait :Error
4:) [Fri Jan 25 15:15:06 2019] ERROR: This is the none message