runtime.csharp.IRT.Logger.ConsoleLogger.cs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idealingua-v1-runtime-rpc-c-sharp_2.13 Show documentation
Show all versions of idealingua-v1-runtime-rpc-c-sharp_2.13 Show documentation
idealingua-v1-runtime-rpc-c-sharp
The newest version!
using System;
using IRT;
namespace IRT.Logger {
public class ConsoleLogger: ILogger {
private LogLevel level;
public ConsoleLogger(LogLevel level) {
this.level = level;
}
public void Logf(LogLevel level, string format, params object[] args) {
if (this.level > level) {
return;
}
var prefix = "[ " + level.ToString() + ", " + DateTime.Now.ToString() + " ]: ";
if (level == LogLevel.Error) {
Console.WriteLine("******************** ERROR ********************\n");
Console.WriteLine(prefix + format, args);
Console.WriteLine("\n***********************************************");
} else {
Console.WriteLine(prefix + format, args);
}
}
}
}