parent
7e6b1500a3
commit
5c75df48fe
@ -0,0 +1,50 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ZelleGames.Log
|
||||
{
|
||||
public enum LogLevel { DEBUG, INFO, WARN, ERROR }
|
||||
|
||||
public static class Logging
|
||||
{
|
||||
//static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
public static void Init()
|
||||
{
|
||||
//var config = new NLog.Config.LoggingConfiguration();
|
||||
//var logfile = new NLog.Targets.FileTarget("logfile") { FileName = "log.txt" };
|
||||
//var loglevel = (Application.isEditor) ? NLog.LogLevel.Debug : NLog.LogLevel.Info;
|
||||
//config.AddRule(loglevel, NLog.LogLevel.Fatal, logfile);
|
||||
|
||||
//NLog.LogManager.Configuration = config;
|
||||
}
|
||||
|
||||
public static void Log(LogLevel level, string message, System.Exception ex)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel.DEBUG:
|
||||
//Logger.Debug(message);
|
||||
Debug.Log(message);
|
||||
break;
|
||||
case LogLevel.INFO:
|
||||
//Logger.Info(message);
|
||||
Debug.Log(message);
|
||||
break;
|
||||
case LogLevel.WARN:
|
||||
Debug.LogWarning(message);
|
||||
//Logger.Warn(message);
|
||||
break;
|
||||
case LogLevel.ERROR:
|
||||
Debug.LogError(message);
|
||||
//Logger.Error(ex, message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Log(LogLevel level, string message)
|
||||
{
|
||||
Log(level, message, null);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue