Exemple #1
0
 /// <summary>
 /// Log an exception object with custom additional information (for instance variable values at the time of the exception), example use in a catch block
 /// </summary>
 /// <param name="level">The LogLevel to assign to this message</param>
 /// <param name="e">The exception object to log</param>
 /// <param name="comment">Any additional information</param>
 public void log(LogLevel level, Exception e, String comment)
 {
     if ((int)loggerLevel <= (int)level)
     {
         WPCException ex = new WPCException(level, e, comment);
         if (Debugger.IsAttached)
         {
             Debug.WriteLine(ex.getDebugOutput());
         }
         if (toFile || level.Equals(LogLevel.critical) || level.Equals(LogLevel.error))
         {
             logToFile(ex);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Log an exception object with custom additional information (for instance variable values at the time of the exception), example use in a catch block
 /// </summary>
 /// <param name="level">The LogLevel to assign to this message</param>
 /// <param name="e">The exception object to log</param>
 /// <param name="comment">Any additional information</param>
 public void log(LogLevel level, Exception e, String comment)
 {
     if ((int)loggerLevel <= (int)level)
     {
         WPCException ex = new WPCException(level, e, comment);
         if (Debugger.IsAttached)
         {
             Debug.WriteLine(ex.getDebugOutput());
         }
         if (toFile || level.Equals(LogLevel.critical))
         {
             logToFile(ex);
         }
     }
 }