コード例 #1
0
ファイル: logger.cs プロジェクト: FFMG/myoddweb.classifier
        /// <summary>
        /// Log a message to the engine
        /// </summary>
        /// <param name="message"></param>
        /// <param name="level"></param>
        private void LogMessageToEngine(string message, LogLevels level)
        {
            // can we log this?
            if (!_options.CanLog(level))
            {
                return;
            }

            //  create the json string.
            var lm = new LogData {
                Level = level, Message = message
            };
            var json = JsonConvert.SerializeObject(lm, Formatting.None);

            // log the string now.
            Log(LogSource(level), json);
        }