//! Trace a functional message of any level, any number of arguments public void TracePerformanceLvl(ICONISTraceLevel lvl, string message, params object[] args) { if (m_TraceSwitch.IsTraceable(ICONISTraceType.PERFORMANCE, lvl)) { Trace.WriteLine(" PERFORMANCE\t" + ((ulong)lvl).ToString() + "\t" + m_strComponentName + "\t\t" + String.Format(message, args)); } }
//! Trace a functional message of any level, any number of arguments public void TraceFunctionalLvl(ICONISTraceLevel lvl, string message, params object[] args) { if (m_TraceSwitch.IsTraceable(ICONISTraceType.FUNCTIONAL, lvl)) { Trace.WriteLine(" FUNCTIONAL\t\t" + ((ulong)lvl).ToString() + "\t" + m_strComponentName + "\t\t" + String.Format(message, args)); } }
//! Trace a debug message of any level, any number of arguments public void TraceDebugLvl(ICONISTraceLevel lvl, string message, params object[] args) { if (m_TraceSwitch.IsTraceable(ICONISTraceType.DEBUG, lvl)) { Trace.WriteLine(" DEBUG\t\t" + ((ulong)lvl).ToString() + "\t" + m_strComponentName + "\t\t" + String.Format(message, args)); } }
///check if a trace is activated public bool IsTraceable(ICONISTraceType type, ICONISTraceLevel lvl) { if (type == ICONISTraceType.ERROR) { return(true); } if (lvl > m_SelectedTraceLevel) { return(false); } if ((m_ActivatedTraceMask & ((ulong)type)) != 0) { return(true); } return(false); }
/// Constructor public IconisTraceSwitch(ulong lMask, ICONISTraceLevel lvl) { m_ActivatedTraceMask = lMask; m_SelectedTraceLevel = lvl; }
/// Constructor public IconisTraceSwitch() { m_ActivatedTraceMask = 0; m_SelectedTraceLevel = ICONISTraceLevel.LEVEL_1; }
// Check if traces of given type and level are activated public bool IsTraceable(ICONISTraceType type, ICONISTraceLevel lvl) { return m_TraceSwitch.IsTraceable(type, lvl); }
//! Trace a debug message of any level, no argument public void TraceDebugLvl(ICONISTraceLevel lvl, string message) { if (m_TraceSwitch.IsTraceable(ICONISTraceType.DEBUG, lvl)) Trace.WriteLine(" DEBUG\t\t" + ((ulong)lvl).ToString() + "\t" + m_strComponentName + "\t\t" + message); }