public static void LogInfo(BepInEx.Logging.LogLevel l, string info) { if (_logger != null) { _logger(l, info); } }
/// <summary> /// Produce a log entry with the given level and message /// </summary> /// <param name="level"></param> /// <param name="message"></param> public void Log(BepInEx.Logging.LogLevel level, string message) { if (_log != null) { _log(level, message); } }
private static void SendToFile(string text, LogLevel level = LogLevel.Info, string tag = "", int lineNumber = 0) { string t = DateTime.Now.ToString("HH:mm:ss"); string log_text = $"[{t}][{tag}]{text}"; if (isDetail && TheOtherRolesPlugin.DebugMode.Value) { StackFrame stack = new StackFrame(2); string class_name = stack.GetMethod().ReflectedType.Name; string method_name = stack.GetMethod().Name; log_text = $"[{t}][{class_name}.{method_name}({lineNumber})][{tag}]{text}"; } TheOtherRolesPlugin.Logger.Log(level, log_text); if (isAlsoInGame) { SendInGame(text); } }
#pragma warning restore IDE0051 // Remove unused private members internal static void Log(BepInEx.Logging.LogLevel level, System.Object data, String member, Int32 line) { if (data == null) { Main.instance.Logger.LogError("Null data sent by: " + member + " line: " + line); return; } if (level == BepInEx.Logging.LogLevel.Fatal || level == BepInEx.Logging.LogLevel.Error || level == BepInEx.Logging.LogLevel.Warning | level == BepInEx.Logging.LogLevel.Message) { Main.instance.Logger.Log(level, data); } else { #if LOGGING Main.instance.Logger.Log(level, data); #endif } #if FINDLOGS Main.instance.Logger.LogWarning("Log: " + level.ToString() + " called by: " + member + " : " + line); #endif }
public static void Log(BepInEx.Logging.LogLevel level, string message) { LogEvent?.Invoke(level, message); }
internal static void Log(BepInEx.Logging.LogLevel level, object text) => BepInEx.Logger.Log(level, text?.ToString());
internal static void Log(BepInEx.Logging.LogLevel level, string text) => BepInEx.Logger.Log(level, text);