コード例 #1
0
        public void Log(DxEventSeverity severity, int id, string formatString, params object[] args)
        {
            DxStoreHACrimsonEvent eventBySeverity = this.GetEventBySeverity(severity);
            string text = string.Format(formatString, args);

            eventBySeverity.LogGeneric(new object[]
            {
                id,
                text
            });
            string text2 = string.Format("[{0}] {1}: {2}", severity, id, text);

            if (this.isLogToConsole)
            {
                Console.WriteLine(text2);
            }
            switch (severity)
            {
            case DxEventSeverity.Error:
                ExTraceGlobals.EventLoggerTracer.TraceError((long)id, text2);
                return;

            case DxEventSeverity.Warning:
                ExTraceGlobals.EventLoggerTracer.TraceWarning((long)id, text2);
                return;

            default:
                ExTraceGlobals.EventLoggerTracer.TraceDebug((long)id, text2);
                return;
            }
        }
コード例 #2
0
        public void LogPeriodic(string periodicKey, TimeSpan periodicDuration, DxEventSeverity severity, int id, string formatString, params object[] args)
        {
            DxStoreHACrimsonEvent eventBySeverity = this.GetEventBySeverity(severity);
            string text = string.Format(formatString, args);

            eventBySeverity.LogPeriodicGeneric(periodicKey, periodicDuration, new object[]
            {
                id,
                text
            });
            if (this.isLogToConsole)
            {
                Console.WriteLine("[{0}] {1}: (P) {2}", severity, id, text);
            }
        }