コード例 #1
0
        /// <summary>
        /// Creates a log
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="text"></param>
        public void CreateLog(Log_level logLevel, string text)
        {
            //Only log if the global log level allows it (e.g. if debug is desired -> all is logged)
            if (logLevel <= this.Level)
            {
                switch (logLevel)
                {
                case Log_level.L_DEBUG:
                    this.LogDebug(text);
                    break;

                case Log_level.L_INFO:
                    this.LogInfo(text);
                    break;

                case Log_level.L_ERROR:
                    this.LogError(text);
                    break;
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Static logging method
 /// </summary>
 /// <param name="logLevel"></param>
 /// <param name="text"></param>
 public static void Log(Log_level logLevel, string text)
 {
     //Call the assigned instance if defined
     Instance?.CreateLog(logLevel, text);
 }