예제 #1
0
파일: LogMessage.cs 프로젝트: vvvv/stride
 /// <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;
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 /// <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);
 }
예제 #6
0
 /// <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);
 }
예제 #7
0
 /// <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);
 }
예제 #8
0
 /// <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);
 }
예제 #9
0
 /// <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));
 }
예제 #10
0
 /// <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);
 }
예제 #11
0
 /// <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));
 }
예제 #12
0
 /// <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);
 }