forked from mirror/DotRecast
remove demolog
This commit is contained in:
parent
6f758cabc0
commit
5806de7f82
|
@ -1,27 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using Serilog;
|
|
||||||
using Silk.NET.OpenGL;
|
|
||||||
|
|
||||||
namespace DotRecast.Recast.Demo;
|
|
||||||
|
|
||||||
public static class DemoLog
|
|
||||||
{
|
|
||||||
private static readonly ILogger Logger = Log.ForContext(typeof(DemoLog));
|
|
||||||
private static HashSet<string> messages = new();
|
|
||||||
|
|
||||||
public static void LogIfGlError(GL gl, [CallerMemberName] string method = "", [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
|
|
||||||
{
|
|
||||||
var err = gl.GetError();
|
|
||||||
if (err == GLEnum.NoError)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var s = $"{method}() err({err}) in {file}:{line}";
|
|
||||||
if (messages.Contains(s))
|
|
||||||
return;
|
|
||||||
|
|
||||||
messages.Add(s);
|
|
||||||
Logger.Error(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue