public static object FromJson(this string json, Type type, bool errorHandling = true, LogWithOptionalParameterList _ = default, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0)
 {
     return(ConfigHelper.ReadConfig(json, type, errorHandling, context: $"{filePath}:{lineNumber} {memberName}"));
 }
        public static string ToJson(this object obj, bool inline = false, bool ignoreNull = true, bool errorHandling = true, LogWithOptionalParameterList _ = default, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0)
        {
            string result = ConfigHelper.WriteConfig(stuff: obj, inline: inline, ignoreNull: ignoreNull, errorHandling: errorHandling, context: $"{filePath}:{lineNumber} {memberName}");

            if (inline)
            {
                result = result.TrimEnd('\r', '\n');
            }
            return(result);
        }
 public static T FromJson <T> (this string json, bool errorHandling = true, LogWithOptionalParameterList _ = default, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0)
     where T : class, new()
 {
     return(ConfigHelper.ReadConfig <T> (json, errorHandling: errorHandling, context: $"{filePath}:{lineNumber} {memberName}"));
 }
Beispiel #4
0
 public static void Fatal <T1, T2, T3, T4>(string format, T1 arg0, T2 arg1, T3 arg2, T4 arg3
                                           , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                                           , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Fatal(String.Format(format, new object[] { arg0, arg1, arg2, arg3 }), _, callerMemberName, callerFilePath);
Beispiel #5
0
 public static void Fatal <T1, T2, T3, T4, T5, T6, T7, T8, T9>(string format, T1 arg0, T2 arg1, T3 arg2, T4 arg3, T5 arg4, T6 arg5, T7 arg6, T8 arg7, T9 arg8
                                                               , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                                                               , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Fatal(String.Format(format, new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }), _, callerMemberName, callerFilePath);
Beispiel #6
0
 public static void Fatal(Exception exception, string message
                          , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                          , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Fatal(message, exception, _, callerFilePath, callerMemberName);
Beispiel #7
0
 public static void Fatal <T>(T value
                              , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                              , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Fatal(value?.ToString(), _, callerMemberName, callerFilePath);
Beispiel #8
0
//================================================================================================================================
// Fatal
//================================================================================================================================
        public static void Fatal(string message
                                 , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                                 , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
        => GetLogger(callerFilePath)?.Fatal(GetIdentifier(callerMemberName) + "[FATAL] " + message);
Beispiel #9
0
 public static void Error <T1, T2, T3, T4, T5, T6>(string format, T1 arg0, T2 arg1, T3 arg2, T4 arg3, T5 arg4, T6 arg5
                                                   , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                                                   , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Error(String.Format(format, new object[] { arg0, arg1, arg2, arg3, arg4, arg5 }), _, callerMemberName, callerFilePath);
Beispiel #10
0
 public static void Error <T1>(string format, T1 arg0
                               , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                               , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Error(String.Format(format, new object[] { arg0 }), _, callerMemberName, callerFilePath);
Beispiel #11
0
 public static void Error(string message, Exception exception
                          , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                          , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Error(message + " | " + exception.ToString(), callerFilePath, callerMemberName);
Beispiel #12
0
 public static void Warn <T1, T2>(string format, T1 arg0, T2 arg1
                                  , LogWithOptionalParameterList _             = default(LogWithOptionalParameterList)
                                  , [CallerMemberName] string callerMemberName = null, [CallerFilePath] string callerFilePath = null)
 => Warn(String.Format(format, new object[] { arg0, arg1 }), _, callerMemberName, callerFilePath);