25 lines
593 B
C#
25 lines
593 B
C#
using System;
|
|
namespace ln.logging
|
|
{
|
|
public static class Logging
|
|
{
|
|
public static void Log(string message, params object[] args)
|
|
{
|
|
Log(LogLevel.INFO, message, args);
|
|
}
|
|
public static void Log(LogLevel level,string message, params object[] args)
|
|
{
|
|
Logger.Default.Log(level,message, args);
|
|
}
|
|
|
|
public static void Log(Exception e){
|
|
Log(LogLevel.ERROR,"Exception: {0} / {1}\n{2}", e.GetType().Name, e.Message, e.StackTrace.ToString());
|
|
if (e.InnerException != null)
|
|
{
|
|
Log(LogLevel.ERROR,"Inner Exception was:");
|
|
Log(e.InnerException);
|
|
}
|
|
}
|
|
}
|
|
}
|