コード例 #1
0
ファイル: XLog.cs プロジェクト: E01D/Base
 public static LogEntry_I LogDebug <TMessage>(object context, LogMessage_I message, [CallerMemberName] string callerMemberName = null,
                                              [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLineNumber = 0)
     where TMessage : LogMessage_I
 {
     return(XLogBase.Api?.Log <TMessage>(new LogSignal()
     {
         GlobalContext = XContextualBase.GetGlobal(),
         Message = message,
         CallerMemberName = callerMemberName,
         CallerFilePath = callerFilePath,
         CallerLineNumber = callerLineNumber,
         LogLevel = LogLevels.Debug
     }));
 }
コード例 #2
0
ファイル: XLog.cs プロジェクト: E01D/Base
 public static LogEntry_I LogException <TException>(TException exception, string message   = null, [CallerMemberName] string callerMemberName = null,
                                                    [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLineNumber    = 0)
     where TException : System.Exception
 {
     return(XLogBase.Api?.Log <TException>(new LogSignal()
     {
         GlobalContext = XContextualBase.GetGlobal(),
         Exception = exception,
         Message = new ExceptionMessage <TException>()
         {
             Message = new Message()
             {
                 Value = message ?? exception?.Message
             }
         },
         CallerMemberName = callerMemberName,
         CallerFilePath = callerFilePath,
         CallerLineNumber = callerLineNumber,
         LogLevel = LogLevels.Error
     }));
 }