示例#1
0
 private void GenFileLog(string str, eI2LogLevel thisLevel)
 {
     if (logLevel <= thisLevel)
     {
         Out(PreForLevel(thisLevel) + FileLog_GetPreText() + str);
     }
 }
示例#2
0
 private void GenFileLog(string str, eI2LogLevel thisLevel)
 {
     if (logLevel <= thisLevel)
     {
         KnownFiles.ioAppend(KnownFiles.eKnownFiles.Log, _2InfoDisplay_DebugOut.PreForLevel(thisLevel) + FileLog_GetPreText() + str);
     }
 }
示例#3
0
 public void Start()
 {
     logLevel = _2InfoDisplay_DebugOut.GetConfiguredLogLevel();
     if (theForm != null)
     {
         throw new ArgumentException("theForm != null");
     }
     theForm = _2InfoDisplay_FromApp_TheForm.CreateAndStart(AreWeReady);
     TheApp  = this;
 }
示例#4
0
        public static string PreForLevel(eI2LogLevel thisLevel)
        {
            DateTime dt = DateTime.Now;
            string   s1 = dt.ToString("dd/MM/yyyy HH:mm:ss.fff ");

            switch (thisLevel)
            {
            case eI2LogLevel.Debug_0: return(s1 + "Debug: ");

            case eI2LogLevel.Info_1: return(s1 + "Info : ");

            case eI2LogLevel.Error_2: return(s1 + "Error: ");
            }
            return("???");
        }
示例#5
0
        public static eI2LogLevel GetConfiguredLogLevel()
        {
            eI2LogLevel ret = eI2LogLevel.Error_2;
            string      cnf = ConfigurationManager.AppSettings["_2InfoDisplay.LogLevel"];

            if (cnf != null)
            {
                switch (cnf)
                {
                case "Debug": ret = eI2LogLevel.Debug_0; break;

                case "Info": ret = eI2LogLevel.Info_1; break;

                case "Error":
                default: ret = eI2LogLevel.Error_2; break;
                }
            }
            return(ret);
        }
示例#6
0
 public void Start()
 {
     logLevel = _2InfoDisplay_DebugOut.GetConfiguredLogLevel();
     Out(".Start");
 }