private static void LogMore(CommonLogger logger) { Stopwatch sw = Stopwatch.StartNew(); logger.LogDebug(typeof(Program), "with MORE"); sw.Stop(); logger.LogInfo(typeof(Program), "How much time to log", "", null, sw.Elapsed); }
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(); }