using System;
using UnityEngine;
namespace ModTool.Shared
{
///
/// Filter level for logging messages to the console or log file.
///
public enum LogLevel { Error = 1, Warning = 2, Info = 3, Debug = 4 }
///
/// A class for logging filtered messages.
///
public class LogUtility
{
///
/// Log a debug message.
///
/// The debug message.
public static void LogDebug(object message)
{
if (ModToolSettings.logLevel >= LogLevel.Debug)
Debug.Log(message);
}
///
/// Log a message.
///
/// The message.
public static void LogInfo(object message)
{
if (ModToolSettings.logLevel >= LogLevel.Info)
Debug.Log(message);
}
///
/// Log a warning.
///
/// The warning message.
public static void LogWarning(object message)
{
if (ModToolSettings.logLevel >= LogLevel.Warning)
Debug.LogWarning(message);
}
///
/// Log an error.
///
/// The error message
public static void LogError(object message)
{
if (ModToolSettings.logLevel >= LogLevel.Error)
Debug.LogError(message);
}
///
/// Log an exception.
///
/// The exception
public static void LogException(Exception exception)
{
if (ModToolSettings.logLevel >= LogLevel.Error)
Debug.LogException(exception);
}
}
}