Example #1
0
File: Log.cs Project: Drummss/Meru
 public static void InitializeLogging(ClientInformation c)
 {
     client = c;
     Directory.CreateDirectory(Directory.GetCurrentDirectory() + "/logs");
     if (client.CanFileLog(LogLevel.ERROR))
     {
         log = new FileWriter($"log_{DateTime.Now.ToFileTime()}.log", "/logs");
     }
 }
Example #2
0
File: Log.cs Project: amishshah/IA
        /// <summary>
        /// Display a [msg] message.
        /// </summary>
        /// <param name="message">information about the action</param>
        public static void Message(string message)
        {
            if (client == null)
            {
                return;
            }

            Console.ForegroundColor = ConsoleColor.White;
            if (client.CanLog(LogLevel.MESSAGE))
            {
                Console.WriteLine("[msg]: " + message);
            }
            if (client.CanFileLog(LogLevel.MESSAGE))
            {
                log?.Write(message);
            }
        }