Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions C7/GodotSink.cs

This file was deleted.

4 changes: 0 additions & 4 deletions C7/LogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,17 @@ public override void _Ready() {
// Includes all logs of an 'Information' level regardless of namespace, and all logs of
// the C7Engine.AI namespace regardless of log level.
Log.Logger = new LoggerConfiguration()
// .WriteTo.GodotSink(formatter: consoleTemplate) //Writing to console can slow the game down considerably (see #278). Thus it is disabled by default.
.WriteTo.File("log.txt", buffered: true, flushToDiskInterval: TimeSpan.FromMilliseconds(250), fileSizeLimitBytes: 52428800, //50 MB
outputTemplate: "[{Level:u3}] {Timestamp:HH:mm:ss} {SourceContext}: {Message:lj} {NewLine}{Exception}")

.Filter.ByIncludingOnly("(@l = 'Fatal' OR @l = 'Error' OR @l = 'Warning' OR @l = 'Information')") //suggested: OR SourceContext like 'C7Engine.AI.%' (insert the namespace you need to debug)
.MinimumLevel.Debug()
.CreateLogger();

GD.Print("Hello logger!");
Log.ForContext<LogManager>().Debug("Hello!");
}

public override void _Notification(int what) {
if (what == ((long)DisplayServer.WindowEvent.CloseRequest)) {
GD.Print("Goodbye logger!");
Log.ForContext<LogManager>().Debug("Goodbye!");
Log.CloseAndFlush();
GetTree().Quit();
Expand Down