|
|
@@ -145,6 +145,8 @@ namespace GamecraftModdingAPI.Utility |
|
|
|
Svelto.Console.SystemLog(obj.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
// descriptive logging |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Write a descriptive message to Gamecraft's log only when the API is a Debug build |
|
|
|
/// </summary> |
|
|
@@ -167,5 +169,56 @@ namespace GamecraftModdingAPI.Utility |
|
|
|
var method = (new StackTrace()).GetFrame(1).GetMethod(); |
|
|
|
Log($"[{DateTime.Now.ToString()}][{method.DeclaringType.Name}.{method.Name}]{obj.ToString()}"); |
|
|
|
} |
|
|
|
|
|
|
|
// CLI logging |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Write a message to Gamecraft's command line |
|
|
|
/// </summary> |
|
|
|
/// <param name="obj">The object to log</param> |
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLog(object obj) |
|
|
|
{ |
|
|
|
CommandLog(obj.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLog(string msg) |
|
|
|
{ |
|
|
|
uREPL.Log.Output(msg); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Write an error message to Gamecraft's command line |
|
|
|
/// </summary> |
|
|
|
/// <param name="obj">The object to log</param> |
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLogError(object obj) |
|
|
|
{ |
|
|
|
CommandLogError(obj.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLogError(string msg) |
|
|
|
{ |
|
|
|
uREPL.Log.Error(msg); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Write a warning message to Gamecraft's command line |
|
|
|
/// </summary> |
|
|
|
/// <param name="obj">The object to log</param> |
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLogWarning(object obj) |
|
|
|
{ |
|
|
|
CommandLogWarning(obj.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static void CommandLogWarning(string msg) |
|
|
|
{ |
|
|
|
uREPL.Log.Warn(msg); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |