Exemple #1
0
        /// <summary>
        /// Method to logs with 1 parameter
        /// </summary>
        /// <param name="logMessage">Text of message</param>
        public void Log(string logMessage)
        {
            var log         = new { Message = logMessage };
            var writeToFile = new WriteToFile();

            writeToFile.AddToJson(log, Path);
        }
Exemple #2
0
        /// <summary>
        /// Method to logs with 3 parameters
        /// </summary>
        /// <param name="logMessage">Text of message</param>
        /// <param name="logLevel">Level og loggining</param>
        /// <param name="dateTime">Date and time creating logs</param>
        public void Log(string logMessage, LogLevel logLevel, DateTime dateTime)
        {
            var log = new
            {
                Message = logMessage,
                Level   = logLevel,
                Date    = dateTime
            };
            var writeToFile = new WriteToFile();

            writeToFile.AddToJson(log, Path);
        }