A fork of the logging library known as Serilog, based off v2.12.0 for compatability with .NET client-side FiveM
public class Script : BaseScript
{
public Script()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.FiveM()
.CreateLogger();
}
[Command("client")]
public void Command()
{
try
{
Log.Logger.Debug("Hello from the FiveM Client!");
Log.Logger.Information("Player is located at {Position}", Game.Player.Character.Position.ToString());
}
catch (Exception e)
{
Log.Logger.Error(e, "Exception hit!");
}
}
}
Changes from v2.12.0 of Serilog
- #1 - Trim files, remove assembly signing, only target net452
- #2 - Add CI/CD proceeded by fix in #4
- #3 - Remove extra performance tests & results, this just bloated things for the purpose of this fork
- #5 - Un-yield
yield return
andyield break
uses - #6 - Add
get
set
to PropertyToken._position - #7 - Add FiveM Client Console Sink
- This fork is in NO WAY affiliated with the Serilog Organization or the Serilog project, it's purely a fork to provide compatability with FiveM's client-resource shipped mono
- This fork ONLY PROVIDES support for incompatibilities with .NET client-side FiveM, if there's an incompatibility report it here