Ejemplo n.º 1
0
        public static void Fatal(string format, params object[] args)
        {
            EnsureConfig();
            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelFatal))
            {
                SetupThreadContext();
                log.FatalFormat(format, args);
            }
        }
Ejemplo n.º 2
0
        public static void Error(IFormatProvider provider, string format, params object[] args)
        {
            EnsureConfig();
            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelError))
            {
                SetupThreadContext();
                log.ErrorFormat(provider, format, args);
            }
        }
Ejemplo n.º 3
0
        public static void Fatal(object message)
        {
            EnsureConfig();
            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelFatal))
            {
                SetupThreadContext();
                log.Fatal(message);
            }
        }
Ejemplo n.º 4
0
        public static void Error(Exception exception)
        {
            EnsureConfig();
            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelError))
            {
                SetupThreadContext();
                log.Error(exception.Message, exception);
            }
        }
Ejemplo n.º 5
0
        public static void Warn(string message, Exception exception)
        {
            EnsureConfig();
            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelWarn))
            {
                SetupThreadContext();
                log.Warn(message, exception);
            }
        }
Ejemplo n.º 6
0
        public static void Trace(string message)
        {
            EnsureConfig();

            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelTrace))
            {
                SetupThreadContext();
                log.Trace(message);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        ///   Standard method to use on method exit
        /// </summary>
        public static void MethodExit()
        {
            EnsureConfig();

            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelTrace))
            {
                SetupThreadContext();
                log.TraceFormat("Method [{0}] Returned", CallingFrame.GetMethod().Name);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        ///   Standard method to use on method exit
        /// </summary>
        public static void MethodExit(object returnObject)
        {
            EnsureConfig();

            var log = DnnLogger.GetClassLogger(CallingType);

            if (log.Logger.IsEnabledFor(DnnLogger.LevelTrace))
            {
                if (returnObject == null)
                {
                    returnObject = "NULL";
                }

                SetupThreadContext();
                log.TraceFormat("Method [{0}] Returned [{1}]", CallingFrame.GetMethod().Name, returnObject);
            }
        }