Exemplo n.º 1
0
 public static void Log <T>(this IJasilyLoggerObject <T> obj,
                            JasilyLogger.LoggerMode mode,
                            string message,
                            JasilyLogger logger = null,
                            [CallerMemberName] string member = "",
                            [CallerLineNumber] int line      = 0)
 {
     (logger ?? JasilyLogger.Current).WriteLine <T>(mode, message, member, line);
 }
 private static Type SelectType(this IJasilyLoggerObject obj) => obj.GetType();
 public static void LogException <T>(this IJasilyLoggerObject <T> obj,
                                     JasilyLoggerMode mode, Exception e, [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
 => obj.GetLogger().WriteException(mode, obj.SelectType(), e, member, line);
 private static Type SelectType <T>(this IJasilyLoggerObject <T> obj) => typeof(T);
 public static void LogError <T>(this IJasilyLoggerObject <T> obj,
                                 JasilyLoggerMode mode, string message, [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
 => obj.GetLogger().WriteError(mode, obj.SelectType(), message, member, line);