Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="i_Level"></param>
        /// <returns></returns>
        protected eSeverity ConvertNSLevelToSeverity(NSpring.Logging.Level i_Level)
        {
            eSeverity eRet = m_FilterLevel;

            SetLastError(0, "");

            if (i_Level == NSpring.Logging.Level.All)
            {
                eRet = eSeverity.Debug;
            }
            else if (i_Level == NSpring.Logging.Level.Config)
            {
                eRet = eSeverity.Debug;
            }
            else if (i_Level == NSpring.Logging.Level.Debug)
            {
                eRet = eSeverity.Debug;
            }
            else if (i_Level == NSpring.Logging.Level.Exception)
            {
                eRet = eSeverity.Error;
            }
            else if (i_Level == NSpring.Logging.Level.Info)
            {
                eRet = eSeverity.Info;
            }
            else if (i_Level == NSpring.Logging.Level.None)
            {
                eRet = eSeverity.Crash;
            }
            else if (i_Level == NSpring.Logging.Level.Verbose)
            {
                eRet = eSeverity.Debug;
            }
            else if (i_Level == NSpring.Logging.Level.Warning)
            {
                eRet = eSeverity.Warning;
            }
            // `else` not needed, default assigned above.

            return(eRet);
        }         // ConvertNSLevelToSeverity
Пример #2
0
        }         // ConvertNSLevelToSeverity

        protected NSpring.Logging.Level ConvertSeverityToNSLevel(eSeverity i_Severity)
        {
            NSpring.Logging.Level lRet = NSpring.Logging.Level.Debug;

            SetLastError(0, "");

            switch (i_Severity)
            {
            case eSeverity.Crash:
                lRet = NSpring.Logging.Level.Exception;
                break;

            case eSeverity.Critical:
                lRet = NSpring.Logging.Level.Exception;
                break;

            case eSeverity.Debug:
                lRet = NSpring.Logging.Level.Debug;
                break;

            case eSeverity.Error:
                lRet = NSpring.Logging.Level.Exception;
                break;

            case eSeverity.Info:
                lRet = NSpring.Logging.Level.Info;
                break;

            case eSeverity.Warning:
                lRet = NSpring.Logging.Level.Warning;
                break;

            default:
                // Default assigned above
                break;
            }

            return(lRet);
        }         // ConvertSeverityToLevel