/// <summary> /// Initializes a new instance of the <see cref="LogMessage" /> class. /// </summary> /// <param name="module">The module.</param> /// <param name="type">The type.</param> /// <param name="text">The text.</param> /// <param name="exception">The exception.</param> /// <param name="callerInfo">The caller info.</param> public LogMessage(string module, LogMessageType type, string text, Exception exception, CallerInfo callerInfo) { Module = module; Type = type; Text = text; Exception = exception; CallerInfo = callerInfo; }
/// <summary> /// Logs the specified info message. /// </summary> /// <param name="logger">The logger.</param> /// <param name="message">The info message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public static void Info([NotNull] this ILogger logger, string message, CallerInfo callerInfo = null) { Info(logger, message, null, callerInfo); }
/// <summary> /// Logs the specified warning message with an exception. /// </summary> /// <param name="logger">The logger.</param> /// <param name="message">The warning message.</param> /// <param name="exception">An exception to log with the message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public static void Warning([NotNull] this ILogger logger, string message, Exception exception, CallerInfo callerInfo = null) { logger.Log(new LogMessage(logger.Module, LogMessageType.Warning, message, exception, callerInfo)); }
/// <summary> /// Logs the specified warning message with an exception. /// </summary> /// <param name="message">The warning message.</param> /// <param name="exception">An exception to log with the message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Warning(string message, Exception exception, CallerInfo callerInfo = null) { Log(new LogMessage(Module, LogMessageType.Warning, message, exception, callerInfo)); }
/// <summary> /// Logs the specified warning message. /// </summary> /// <param name="message">The warning message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Warning(string message, CallerInfo callerInfo = null) { Warning(message, null, callerInfo); }
/// <summary> /// Logs the specified debug message. /// </summary> /// <param name="message">The debug message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Debug(string message, CallerInfo callerInfo = null) { Debug(message, null, callerInfo); }
/// <summary> /// Logs the specified info message. /// </summary> /// <param name="message">The info message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Info(string message, CallerInfo callerInfo = null) { Info(message, null, callerInfo); }
/// <summary> /// Logs the specified verbose message. /// </summary> /// <param name="message">The verbose message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Verbose(string message, CallerInfo callerInfo = null) { Verbose(message, null, callerInfo); }
/// <summary> /// Logs the specified verbose message with an exception. /// </summary> /// <param name="message">The verbose message.</param> /// <param name="exception">An exception to log with the message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Verbose(string message, Exception exception, CallerInfo callerInfo = null) { Log(new LogMessage(Module, LogMessageType.Verbose, message, exception, callerInfo)); }
/// <summary> /// Logs the specified fatal message. /// </summary> /// <param name="message">The fatal message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Fatal(string message, CallerInfo callerInfo = null) { Fatal(message, null, callerInfo); }
/// <summary> /// Logs the specified fatal message with an exception. /// </summary> /// <param name="message">The fatal message.</param> /// <param name="exception">An exception to log with the message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Fatal(string message, Exception exception, CallerInfo callerInfo = null) { Log(new LogMessage(Module, LogMessageType.Fatal, message, exception, callerInfo)); }
/// <summary> /// Logs the specified error message. /// </summary> /// <param name="message">The error message.</param> /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param> public void Error(string message, CallerInfo callerInfo = null) { Error(message, null, callerInfo); }