Sandbox.Diagnostics.Logger : api/Sandbox.Diagnostics.Logger
using Sandbox; using Sandbox.Diagnostics; public class LoggerExample { // ConCmd executed via the console command "logger_example" [ConCmd("logger_example")] public static void ConCmdInstantiatedLoggerExample() { // The default (GameMenu) logger accessible via Log.Info, Log.Warning, Log.Error, etc. Log.Info("Info"); Log.Warning("Warning"); Log.Error("Error"); // You can also instantiate a Logger with a custom name. var myLogger = new Logger("MyLogger"); myLogger.Info("Info"); myLogger.Warning("Warning"); myLogger.Error("Error"); } }