示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="ex"></param>
        /// <param name="printStack"></param>
        public static void LogException(this IWorkingContext context, Exception ex, bool printStack = false)
        {
            string component    = GetCallingMethod(2);
            string exceptionStr = ex.FormatException(printStack);

            context.Log(component, TraceLevel.Error, CommonUtils.DefaultCategory, exceptionStr);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="args"></param>
        public static void LogError(this IWorkingContext context, string msg, params object[] args)
        {
            string component = GetCallingMethod(2);

            context.Log(component, TraceLevel.Error, CommonUtils.DefaultCategory, msg, args);
        }