Example #1
0
        public void Error(Exception e, string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                Error(e);
                return;
            }

            string msg = null;

            if (ConsoleLogLevel.AtLeast(LogLevel.Verbose))
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0} : {1}\n{2}", message, e.Message, e.StackTrace);
            }
            else
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0} : {1}", message, e.Message);
            }

            if (ConsoleLogLevel.AtLeast(LogLevel.Error))
            {
                ConsoleLog(msg);
                LogRemoteException(e, msg);
            }
        }
Example #2
0
        public void Log(string format, params object[] args)
        {
            var msg = MessageFormatUtility.FormatMsg(LogLevel.Info, format, args);

            if (ConsoleLogLevel.AtLeast(LogLevel.Info))
            {
                ConsoleLog(msg);
            }
        }
Example #3
0
        public void Log(string message)
        {
            var msg = MessageFormatUtility.FormatMsg(LogLevel.Info, message);

            if (ConsoleLogLevel.AtLeast(LogLevel.Info))
            {
                ConsoleLog(msg);
            }
        }
Example #4
0
        public void Error(string message)
        {
            var msg = MessageFormatUtility.FormatMsg(LogLevel.Error, message);

            if (ConsoleLogLevel.AtLeast(LogLevel.Error))
            {
                ConsoleLog(msg);
            }
        }
Example #5
0
        public void Error(Exception e, string format, params object[] args)
        {
            string msg = null;

            if (ConsoleLogLevel.AtLeast(LogLevel.Verbose))
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0} : {1}\n{2}", String.Format(format, args), e.Message, e.StackTrace);
            }
            else
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0}: {1}", String.Format(format, args), e.Message);
            }

            if (ConsoleLogLevel.AtLeast(LogLevel.Error))
            {
                ConsoleLog(msg);
                LogRemoteException(e, msg);
            }
        }
Example #6
0
        public void Error(Exception e)
        {
            string msg = null;

            if (ConsoleLogLevel.AtLeast(LogLevel.Verbose))
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0}\n{1}", e.Message, e.StackTrace);
            }
            else
            {
                msg = MessageFormatUtility.FormatMsg(LogLevel.Error, "{0}", e.Message);
            }

            if (ConsoleLogLevel.AtLeast(LogLevel.Error))
            {
                ConsoleLog(msg);
                LogRemoteException(e);
            }
        }