Example #1
0
        public void LogWithTime(string msg)
        {
            try
            {
                if (!_enabled)
                {
                    return;
                }

                FileLogger.LogWithTime(msg);
            }
            catch (Exception ee)
            {
                InnerExceptionOccurred?.Invoke(ee);
            }
        }
Example #2
0
        public void Log(string errorType, string msg, string location, ErrorLevel level)
        {
            try
            {
                if (!_enabled)
                {
                    return;
                }

                var ss = string.Format("\n{0} : {1} -- {2} 。错误类型:{3}。位置:{4}",
                                       DateTime.Now.ToString(CultureInfo.CurrentCulture), level.GetDescription(), msg, errorType,
                                       location);

                FileLogger.Log(ss);
            }
            catch (Exception ee)
            {
                InnerExceptionOccurred?.Invoke(ee);
            }
        }