Last active
September 28, 2024 07:59
-
-
Save Ddemon26/5ceadb7934a23900c95ef932c2f75b9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class Logger { | |
const string CLASS_NAME = "LogThisWithColor"; | |
const string LOG_COLOR = "green"; | |
static string ClassName => CLASS_NAME.SetPrefix(); | |
static string SetPrefix(this string newString) => $"<color={LOG_COLOR}>[{newString}]</color>"; | |
public static void Log(string message) => Debug.Log($"{ClassName} {message}"); | |
public static void LogWarning(string message) => Debug.LogWarning($"{ClassName} {message}"); | |
public static void LogError(string message) => Debug.LogError($"{ClassName} {message}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment