2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
10using Microsoft.Xna.Framework;
15 public partial class CUI
22 return $
"‖color:{color}‖{msg}‖end‖";
31 return $
"[{String.Join(",
", array.Select(o => o.ToString()))}]";
37 public static void Log(
object msg, Color? color =
null, [CallerFilePath]
string source =
"", [CallerLineNumber]
int lineNumber = 0)
44 LuaCsLogger.LogMessage($
"{msg ?? "null"}", color * 0.8f, color);
47 public static void Warning(
object msg, Color? color =
null, [CallerFilePath]
string source =
"", [CallerLineNumber]
int lineNumber = 0)
49 color ??= Color.Yellow;
52 LuaCsLogger.LogMessage($
"{msg ?? "null"}", color * 0.8f, color);
60 public static string GetCallerFolderPath([CallerFilePath]
string source =
"") => Path.GetDirectoryName(source);
66 public static void Info(
object msg, [CallerFilePath]
string source =
"", [CallerLineNumber]
int lineNumber = 0)
70 var fi =
new FileInfo(source);
72 Log($
"{fi.Directory.Name}/{fi.Name}:{lineNumber}", Color.Yellow * 0.5f);
73 Log(msg, Color.Yellow);
static bool Debug
This affects logging.
static string GetCallerFolderPath([CallerFilePath] string source="")
xd
static void Log(object msg, Color? color=null, [CallerFilePath] string source="", [CallerLineNumber] int lineNumber=0)
Prints a message to console.
static string ArrayToString(IEnumerable< object > array)
Serializes the array.
static string WrapInColor(object msg, string color)
$"‖color:{color}‖{msg}‖end‖"
static void Info(object msg, [CallerFilePath] string source="", [CallerLineNumber] int lineNumber=0)
Prints debug message with source path Works only if debug is true.