You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

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);
}
}
}