Ejemplo n.º 1
0
        public void Log(LogLevel level, Exception ex, string messageFormatString, params object[] formatStringParameters)
        {
            switch (level)
            {
            case LogLevel.Debug:
            {
                TheLogger.Debug(CallingMethodName + " " + FormattedString(messageFormatString, formatStringParameters) + ex.ToFullException()
                                , ex);
                break;
            }


            case LogLevel.Info:
            {
                TheLogger.Info(CallingMethodName + " " + FormattedString(messageFormatString, formatStringParameters) + ex.ToFullException(), ex);
                break;
            }

            case LogLevel.Warn:
            {
                TheLogger.Warn(CallingMethodName + " " + FormattedString(messageFormatString, formatStringParameters) + ex.ToFullException(), ex);
                break;
            }

            case LogLevel.Error:
                Error(ex, messageFormatString, formatStringParameters);
                break;

            case LogLevel.Fatal:
                Fatal(ex, messageFormatString, formatStringParameters);
                break;

            default:
                throw new InvalidOperationException("Unknown LogLevel");
            }
        }
Ejemplo n.º 2
0
 public void Warn(string messageFormatString, params object[] formatStringParameters)
 {
     TheLogger.Warn(CallingMethodName + ": " + FormattedString(messageFormatString, formatStringParameters));
 }