Health/Assets/Scripts/Tool/LogPrint.cs

64 lines
1.4 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LogPrint
{
public static PrintLevel Level = PrintLevel.Normal;
public static void Log(object message, PrintLevel logLevel = PrintLevel.Details)
{
if (logLevel >= Level)
{
Debug.Log(message);
}
}
public static void Log(object message, UnityEngine.Object sender, PrintLevel logLevel = PrintLevel.Details)
{
if (logLevel >= Level)
{
Debug.Log(message, sender);
}
}
public static void Warning(object message, PrintLevel level = PrintLevel.Details)
{
if (level >= Level)
{
Debug.LogWarning(message);
}
}
public static void Warning(object message, UnityEngine.Object sender, PrintLevel logLevel = PrintLevel.Details)
{
if (logLevel >= Level)
{
Debug.LogWarning(message, sender);
}
}
public static void Error(object message, PrintLevel level = PrintLevel.Details)
{
if (level >= Level)
{
Debug.LogError(message);
}
}
public static void Exception(Exception ex, PrintLevel level = PrintLevel.Details)
{
if (level >= Level)
{
Debug.LogException(ex);
}
}
}
public enum PrintLevel
{
Details = 0,
Normal = 10,
Important = 100,
Critical = 200,
}