Health/Assets/Scripts/Tool/LogPrint.cs

64 lines
1.4 KiB
C#
Raw Normal View History

2023-11-24 05:13:10 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LogPrint
{
2023-11-24 12:04:16 +00:00
public static PrintLevel Level = PrintLevel.Details;
2023-11-24 05:13:10 +00:00
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,
}