Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 10:21:41 (15 years ago)
Author:
epitzer
Message:

Fix warnings (#915)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tracing/3.2/Logger.cs

    r2790 r3057  
    2929namespace HeuristicLab.Tracing {
    3030
     31  /// <summary>
     32  /// HeuristicLab Tracing entry point. Default logger. Reads configured tracing
     33  /// file and provides automatic logging with reflection of the calling type.
     34  /// </summary>
    3135  public class Logger {
    3236
     37    /// <summary>
     38    /// true if Configure has been called already.
     39    /// </summary>
    3340    protected static bool IsConfigured = false;
    3441
     42    /// <summary>
     43    /// Configures this instance: Reads the log file specified in the settings.
     44    /// </summary>
    3545    protected static void Configure() {
    3646      if (IsConfigured) return;
     
    4555    }
    4656
     57    /// <summary>
     58    /// Gets the default logger for the calling class n levels up in the
     59    /// call hierarchy.
     60    /// </summary>
     61    /// <param name="nParents">The number of parent calls.</param>
     62    /// <returns>An <see cref="ILog"/> instance.</returns>
    4763    public static ILog GetDefaultLogger(int nParents) {
    4864      Configure();
     
    5167    }
    5268
     69    /// <summary>
     70    /// Gets the default logger: The logger for the class of the
     71    /// calling method.
     72    /// </summary>
     73    /// <returns>An <see cref="ILog"/> instance.</returns>
    5374    public static ILog GetDefaultLogger() {
    5475      Configure();
     
    5778    }
    5879
     80    /// <summary>
     81    /// Issues a debug message to the default logger.
     82    /// </summary>
     83    /// <param name="message">The message.</param>
    5984    public static void Debug(object message) {
    6085      GetDefaultLogger(1).Debug(message);
    6186    }
    6287
     88    /// <summary>
     89    /// Issues an informational message to the default logger.
     90    /// </summary>
     91    /// <param name="message">The message.</param>
    6392    public static void Info(object message) {
    6493      GetDefaultLogger(1).Info(message);
    6594    }
    6695
     96    /// <summary>
     97    /// Issues a warning message to the default logger.
     98    /// </summary>
     99    /// <param name="message">The message.</param>
    67100    public static void Warn(object message) {
    68101      GetDefaultLogger(1).Warn(message);
    69102    }
    70103
     104    /// <summary>
     105    /// Issues an error message to the default logger.
     106    /// </summary>
     107    /// <param name="message">The message.</param>
    71108    public static void Error(object message) {
    72109      GetDefaultLogger(1).Error(message);
    73110    }
    74111
     112    /// <summary>
     113    /// Issues a fatal error message to the default logger.
     114    /// </summary>
     115    /// <param name="message">The message.</param>
    75116    public static void Fatal(object message) {
    76117      GetDefaultLogger(1).Fatal(message);
    77118    }
    78119
     120    /// <summary>
     121    /// Issues a debug message to the logger of the specified type.
     122    /// </summary>
     123    /// <param name="type">The type.</param>
     124    /// <param name="message">The message.</param>
    79125    public static void Debug(Type type, object message) {
    80126      Configure();
     
    82128    }
    83129
     130    /// <summary>
     131    /// Issues an iformational message to the logger of the specified
     132    /// type.
     133    /// </summary>
     134    /// <param name="type">The type.</param>
     135    /// <param name="message">The message.</param>
    84136    public static void Info(Type type, object message) {
    85137      Configure();
     
    87139    }
    88140
     141    /// <summary>
     142    /// Issues a warning message to the logger of
     143    /// the specified type.
     144    /// </summary>
     145    /// <param name="type">The type.</param>
     146    /// <param name="message">The message.</param>
    89147    public static void Warn(Type type, object message) {
    90148      Configure();
     
    92150    }
    93151
     152    /// <summary>
     153    /// Issues an error message to the logger of the specified
     154    /// type.
     155    /// </summary>
     156    /// <param name="type">The type.</param>
     157    /// <param name="message">The message.</param>
    94158    public static void Error(Type type, object message) {
    95159      Configure();
     
    97161    }
    98162
     163    /// <summary>
     164    /// Issues a fatal error message to the logger of
     165    /// the specified type.
     166    /// </summary>
     167    /// <param name="type">The type.</param>
     168    /// <param name="message">The message.</param>
    99169    public static void Fatal(Type type, object message) {
    100170      Configure();
     
    102172    }
    103173
     174    /// <summary>
     175    /// Issues a debug message to the default
     176    /// logger including an exception.
     177    /// </summary>
     178    /// <param name="message">The message.</param>
     179    /// <param name="exception">The exception.</param>
    104180    public static void Debug(object message, Exception exception) {
    105181      GetDefaultLogger(1).Debug(message, exception);
    106182    }
    107183
     184    /// <summary>
     185    /// Issues an informational message to the default
     186    /// logger including an exception.
     187    /// </summary>
     188    /// <param name="message">The message.</param>
     189    /// <param name="exception">The exception.</param>
     190
    108191    public static void Info(object message, Exception exception) {
    109192      GetDefaultLogger(1).Info(message, exception);
    110193    }
    111194
     195    /// <summary>
     196    /// Issues a warning message to the default
     197    /// logger including an exception.
     198    /// </summary>
     199    /// <param name="message">The message.</param>
     200    /// <param name="exception">The exception.</param>
    112201    public static void Warn(object message, Exception exception) {
    113202      GetDefaultLogger(1).Warn(message, exception);
    114203    }
    115204
     205    /// <summary>
     206    /// Issues an error message to the default
     207    /// logger including an exception.
     208    /// </summary>
     209    /// <param name="message">The message.</param>
     210    /// <param name="exception">The exception.</param>
    116211    public static void Error(object message, Exception exception) {
    117212      GetDefaultLogger(1).Error(message, exception);
    118213    }
    119214
     215    /// <summary>
     216    /// Issues a fatal error message to the default
     217    /// logger including an exception.
     218    /// </summary>
     219    /// <param name="message">The message.</param>
     220    /// <param name="exception">The exception.</param>
    120221    public static void Fatal(object message, Exception exception) {
    121222      GetDefaultLogger(1).Fatal(message, exception);
    122223    }
    123224
     225    /// <summary>
     226    /// Issues a debug message to the logger of the specified
     227    /// type including an exception.
     228    /// </summary>
     229    /// <param name="type">The type.</param>
     230    /// <param name="message">The message.</param>
     231    /// <param name="exception">The exception.</param>
    124232    public static void Debug(Type type, object message, Exception exception) {
    125233      Configure();
     
    127235    }
    128236
     237    /// <summary>
     238    /// Issues an informational message to the logger of the specified
     239    /// type including an exception.
     240    /// </summary>
     241    /// <param name="type">The type.</param>
     242    /// <param name="message">The message.</param>
     243    /// <param name="exception">The exception.</param>
    129244    public static void Info(Type type, object message, Exception exception) {
    130245      Configure();
     
    132247    }
    133248
     249    /// <summary>
     250    /// Issues a warning message to the logger of the specified
     251    /// type including an exception.
     252    /// </summary>
     253    /// <param name="type">The type.</param>
     254    /// <param name="message">The message.</param>
     255    /// <param name="exception">The exception.</param>
    134256    public static void Warn(Type type, object message, Exception exception) {
    135257      Configure();
     
    137259    }
    138260
     261    /// <summary>
     262    /// Issues an error message to the logger of the specified
     263    /// type including an exception.
     264    /// </summary>
     265    /// <param name="type">The type.</param>
     266    /// <param name="message">The message.</param>
     267    /// <param name="exception">The exception.</param>
    139268    public static void Error(Type type, object message, Exception exception) {
    140269      Configure();
     
    142271    }
    143272
     273    /// <summary>
     274    /// Issues a fatal error message to the logger of the specified
     275    /// type including an exception.
     276    /// </summary>
     277    /// <param name="type">The type.</param>
     278    /// <param name="message">The message.</param>
     279    /// <param name="exception">The exception.</param>
    144280    public static void Fatal(Type type, object message, Exception exception) {
    145281      Configure();
    146282      LogManager.GetLogger(type).Fatal(message, exception);
    147283    }
    148 
    149284  }
    150285}
Note: See TracChangeset for help on using the changeset viewer.