Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="__record"></param>
        /// <returns></returns>
        public override string format(LogRecord __record)
        {
            StringBuilder message_builder = new StringBuilder();
            message_builder.AppendFormat( "{0}. {1:o} {2}: ",
                                          __record.sequenceNumber,
                                          __record.registerTime,
                                          __record.level.localizedName
                                        );
            if ( __record.sourceClassName.Length > 0 ) {
                message_builder.AppendFormat( "{0}#", __record.sourceClassName );
            }
            if ( __record.sourceMethodName.Length > 0 ) {
                message_builder.AppendFormat( "{0} - ", __record.sourceMethodName );
            }
            if ( __record.message.Length > 0 ) {
                message_builder.AppendFormat( "{0}", __record.message );
            }
            if ( __record.thrown != null ) {
                message_builder.Append( __record.thrown );
                if ( __record.thrown.Data != null ) {
                    foreach ( DictionaryEntry entry in __record.thrown.Data ) {
                        message_builder.AppendFormat( "{0}=>{1}, ", entry.Key, entry.Value );
                    }
                }
            }

            return message_builder.ToString();
        }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__record"></param>
 public abstract string format(LogRecord __record);
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__source_class"></param>
 /// <param name="__source_method"></param>
 /// <param name="__message"></param>
 /// <param name="__thrown"></param>
 /// <param name="__params"></param>
 public void log(Level __level, string __source_class, string __source_method, string __message, Exception __thrown, object[] __params)
 {
     LogRecord record = new LogRecord( __level, string.Format( __message, __params ) );
     record.sourceClassName = __source_class;
     record.sourceMethodName = __source_method;
     record.thrown = __thrown;
     log( record );
 }
Пример #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__record"></param>
 public void log(LogRecord __record)
 {
     if ( isLoggable( __record.level ) ) {
         foreach ( Handler handler in handlers_ ) {
             handler.publish( __record );
         }
     }
 }
Пример #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__source_class"></param>
 /// <param name="__source_method"></param>
 /// <param name="__message"></param>
 /// <param name="__param1"></param>
 public void log(Level __level, string __source_class, string __source_method, string __message, object __param1)
 {
     LogRecord record = new LogRecord( __level, string.Format( __message, __param1 ) );
     record.sourceClassName = __source_class;
     record.sourceMethodName = __source_method;
     log( record );
 }
Пример #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__message"></param>
 /// <param name="__source_class"></param>
 /// <param name="__source_method"></param>
 /// <param name="__thrown"></param>
 public void log(Level __level, string __source_class, string __source_method, string __message, Exception __thrown)
 {
     LogRecord record = new LogRecord( __level, __message );
     record.sourceClassName = __source_class;
     record.sourceMethodName = __source_method;
     record.thrown = __thrown;
     log( record );
 }
Пример #7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__message"></param>
 /// <param name="__params"></param>
 public void log(Level __level, string __message, params object[] __params)
 {
     LogRecord record = new LogRecord( __level, string.Format( __message, __params ) );
     log( record );
 }
Пример #8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__source_class"></param>
 /// <param name="__source_method"></param>
 /// <param name="__message"></param>
 public void log(Level __level, string __source_class, string __source_method, string __message)
 {
     LogRecord record = new LogRecord( __level, __message );
     record.sourceClassName = __source_class;
     record.sourceMethodName = __source_method;
     log( record );
 }
Пример #9
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__level"></param>
 /// <param name="__message"></param>
 /// <param name="__thrown"></param>
 public void log(Level __level, string __message, Exception __thrown)
 {
     LogRecord record = new LogRecord( __level, __message );
     record.thrown = __thrown;
     log( record );
 }
Пример #10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__message"></param>
 public void log(Level __level, string __message)
 {
     LogRecord record = new LogRecord( __level, __message );
     log( record );
 }
Пример #11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__record"></param>
 public override void publish(LogRecord __record)
 {
     base.publish( __record );
     //base.stream.Flush();
 }
Пример #12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__record"></param>
 public override void publish(LogRecord __record)
 {
     this.stream.WriteLine( this.formatter.format( __record ) );
 }
Пример #13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__record"></param>
 public abstract void publish(LogRecord __record);