forked from technogeeky/KSPPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logging.cs
20 lines (16 loc) · 889 Bytes
/
Logging.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
namespace KSPPP.Logging {
public class ConsoleLogger {
internal static string _AssemblyName { get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; } }
internal string _ClassName { get { return this.GetType().Name; } }
[System.Diagnostics.Conditional("DEBUG")]
public static void Debug(string message, params object[] strParams) { Now("DEBUG: " + message, strParams); }
public static void Now (string message, params object[] strParams) {
message = string.Format(message, strParams); // This fills the params into the message
string strMessageLine = string.Format("{1},{0}", message, _AssemblyName); // This adds our standardised wrapper to each line
UnityEngine.Debug.Log(strMessageLine); // And this puts it in the log
}
public static void Main() {
}
}
}