Created
September 5, 2020 02:57
-
-
Save kyubuns/0d5ba6491201417c50077dde4cafd37a 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
public static void Test() | |
{ | |
SugoiLogger.Log("Battle", "ゲーム開始"); | |
// -> Battle | ゲーム開始 | |
var hp = 20; | |
var mp = 10; | |
SugoiLogger.Log("Battle/Status", "今のステータス", (nameof(hp), hp), (nameof(mp), mp)); | |
// -> Battle/Status | 今のステータス | hp = 20, mp = 10 | |
} | |
public static class SugoiLogger | |
{ | |
public static void Log(string category, string message) | |
{ | |
UnityEngine.Debug.Log($"{category} | {message}"); | |
} | |
public static void Log(string category, string message, params (string, object)[] values) | |
{ | |
UnityEngine.Debug.Log($"{category} | {message} | {string.Join(", ", values.Select(x => $"{x.Item1} = {x.Item2}"))}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment