Пример #1
0
        public void DebugLog(int incidentId = 0, int contactId = 0, string logMessage = null, string logNote = null, int timeElapsed = 0,
                             [CallerMemberName] string memberName    = "",
                             [CallerFilePath] string sourceFilePath  = "",
                             [CallerLineNumber] int sourceLineNumber = 0)
        {
            if (ConfigurationSetting.logLevel >= ConfigurationSetting.LogLevelEnum.Debug)
            {
                if (incidentId != 0)
                {
                    incident.ID.id = incidentId;
                }
                else
                {
                    incident.ID.id = 0;
                }

                if (contactId != 0)
                {
                    contact.ID.id = contactId;
                }
                else
                {
                    contact.ID.id = 0;
                }

                string fileName = sourceFilePath.Substring(sourceFilePath.LastIndexOf('\\') + 1);
                string source   = fileName + ":" + memberName + ":" + sourceLineNumber;
                m_log.DebugLog(incident, contact, logMessage, logNote, source, timeElapsed);
            }
            ConfigurationSetting.updateStatusBar("Debug", logMessage);
        }
Пример #2
0
        public void ErrorLog(int incidentId = 0, int contactId = 0, string logMessage = null, string logNote = null, int timeElapsed = 0,
                             [CallerMemberName] string memberName    = "",
                             [CallerFilePath] string sourceFilePath  = "",
                             [CallerLineNumber] int sourceLineNumber = 0)
        {
            Contact  logContact  = null;
            Incident logIncident = null;

            if (incidentId > 0)
            {
                incident.ID.id = incidentId;
                logIncident    = incident;
            }

            if (contactId > 0)
            {
                contact.ID.id = contactId;
                logContact    = contact;
            }

            string fileName = sourceFilePath.Substring(sourceFilePath.LastIndexOf('\\') + 1);
            string source   = fileName + ":" + memberName + ":" + sourceLineNumber;

            m_log.ErrorLog(logIncident, logContact, logMessage, logNote, source, timeElapsed);
            ConfigurationSetting.updateStatusBar("Error", logMessage);
        }