Exemplo n.º 1
0
        /// <summary>
        /// Write a log message to the console, and a file if WriteToFile is true
        /// </summary>
        /// <param name="message">The string to write to the console/logfile</param>
        /// <param name="outputLevel">What level of alert this log is. Will not be displayed/written if Verbosity is lower than this value.</param>
        public static void WriteLog(string message, VerbosityLevels outputLevel = VerbosityLevels.Normal)
        {
            if (Verbosity < outputLevel)
            {
                return;
            }

            Console.WriteLine(message);
            if (WriteToFile)
            {
                lock (fileLock)
                    File.AppendAllText(filename, message + Environment.NewLine);
            }
        }
Exemplo n.º 2
0
 public static bool VerifyVerbosityLevel(VerbosityLevels level)
 {
     return(VerifyVerbosityLevel((int)level));
 }