static void Main(string[] args)
        {
            CommonLogger logger = new CommonLogger();

            logger.LogDataPublish += Logger_LogDataPublish;

            LogMore(logger);
            LogWithException(logger);

            Console.WriteLine("Press any key to quit");
            Console.ReadKey();

            logger.Dispose();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Stopwatch sw = Stopwatch.StartNew();

            CommonLogger logger = new CommonLogger();

            logger.LogDataPublish += (sender, logData) => { WriteTheLogEntry(logData); };

            sw.Stop();

            logger.LogDebug(typeof(Program), "Logging test in .Net Core");
            logger.LogInfo(typeof(Program), "Some Info to be logged");
            LogMore(logger);
            LogWithException(logger);

            var val = (short)logger.AllowedLogLevels;

            LogLevels test = (LogLevels)val;

            Console.ReadKey();

            logger.Dispose();
        }