Example #1
0
        public string Format(ILog log, BootFX.Common.Management.LogLevel level, LogArgs args)
        {
            // mbr - 22-05-2008 - changed this to add date/time, because that's always handy.

//			// mbr - 20-08-2006 - wasn't handling exceptions...
//			if(ex == null)
//				return buf;
//			else
//				return string.Format("{0}\r\n\t{1}", buf, ex);

            // builder...
            StringBuilder builder = new StringBuilder();

            DefaultLogFormatter.AppendDateTime(builder);
            builder.Append(" | ");
            builder.Append(args.Message);

            // ex?
            if (args.HasException)
            {
                builder.Append("\r\n\t");
                builder.Append(args.Exception);
            }

            // return...
            return(builder.ToString());
        }
Example #2
0
 public string Format(ILog log, BootFX.Common.Management.LogLevel level, LogArgs args)
 {
     if (args.HasException)
     {
         return(string.Format("{0}\r\n\r\nException:\r\n{1}", args.Message, args.Exception));
     }
     else
     {
         return(args.Message + "\r\n\r\n(No exception)");
     }
 }
Example #3
0
        public string Format(ILog log, BootFX.Common.Management.LogLevel level, LogArgs args)
        {
            StringBuilder builder = new StringBuilder();

            DefaultLogFormatter.AppendDateTime(builder);
            builder.Append(" | ");
            DefaultLogFormatter.AppendLevelName(builder, level);
            builder.Append(" | ");
            DefaultLogFormatter.AppendThreadName(builder);
            builder.Append(" | ");
            builder.Append(args.Message);

            // ex?
            if (args.HasException)
            {
                builder.Append("\r\n\t");
                builder.Append(args.Exception);
            }

            // return...
            return(builder.ToString());
        }