Exemplo n.º 1
0
        public void Log(string message, LogLevel logLevel)
        {
            string logStr = "[" + DateTime.Now.ToString() + "] " + ConvertEnumToString(logLevel) + ": " + message;

            if (OutputToFile && m_swStreamWriter != null && logLevel >= LogLevel && LogLevel != LogLevel.Silent)
            {
                m_swStreamWriter.WriteLine(logStr);
                m_swStreamWriter.Flush();
            }
            if (OutputToConsole)
            {
                Console.WriteLine(logStr);
            }
            if (OutputToWebAPI)
            {
                m_WebAPIClient.Post("Log", logStr);
            }
        }