forked from Shardstone/trail-into-darkness
43 lines
1.9 KiB
C#
43 lines
1.9 KiB
C#
using System.Diagnostics;
|
|
using System.Runtime.CompilerServices;
|
|
using UnityEngine;
|
|
using Debug = UnityEngine.Debug;
|
|
|
|
namespace Jovian.Utilities {
|
|
|
|
public static class BowserLog {
|
|
|
|
private const string PREFIX = "Bowser:";
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining), DebuggerHidden]
|
|
public static void Log(string log, object obj = null) {
|
|
Debug.Log(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining), DebuggerHidden]
|
|
public static void LogWarning(string log, object obj = null) {
|
|
Debug.LogWarning(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining), DebuggerHidden]
|
|
public static void LogError(string log, object obj = null) {
|
|
Debug.LogError(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
|
|
[Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD"), DebuggerHidden]
|
|
public static void LogDebug(string log, object obj = null) {
|
|
Debug.Log(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
|
|
[Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD"), DebuggerHidden]
|
|
public static void LogWarningDebug(string log, object obj = null) {
|
|
Debug.LogWarning(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
|
|
[Conditional("UNITY_EDITOR"), Conditional("DEVELOPMENT_BUILD"), DebuggerHidden]
|
|
public static void LogErrorDebug(string log, object obj = null) {
|
|
Debug.LogError(obj == null ? $"{PREFIX}{log}" : $"{PREFIX}[{obj.GetType().Name}] {log}", obj as Object);
|
|
}
|
|
}
|
|
}
|