예제 #1
0
        public void Debug(string message, params object[] formatting)
        {
            _logger.Debug(message, formatting);

            var logMessage = new Common.Models.LogMessage
            {
                Context  = _context,
                LogLevel = LogLevel.Debug,
                Message  = string.Format(message, formatting)
            };

            _interceptor?.Invoke(logMessage);
        }
예제 #2
0
        public void Debug(Func <string> message)
        {
            _logger.Debug(message());

            var logMessage = new Common.Models.LogMessage
            {
                Context  = _context,
                LogLevel = LogLevel.Debug,
                Message  = message()
            };

            _interceptor?.Invoke(logMessage);
        }
예제 #3
0
        public void Warn(string message, params object[] formatting)
        {
            _logger.Warning(message, formatting);

            var logMessage = new Common.Models.LogMessage
            {
                Context  = _context,
                LogLevel = LogLevel.Warn,
                Message  = string.Format(message, formatting)
            };

            _interceptor?.Invoke(logMessage);
            _progressService.WriteMessage(logMessage.Message, PowerShellLineType.Warning);
        }
예제 #4
0
        public void Info(Func <string> message)
        {
            _logger.Information(message());

            var logMessage = new Common.Models.LogMessage
            {
                Context  = _context,
                LogLevel = LogLevel.Info,
                Message  = message()
            };

            _interceptor?.Invoke(logMessage);
            _progressService.WriteMessage(logMessage.Message, PowerShellLineType.Output);
        }
예제 #5
0
        public void Fatal(Func <string> message)
        {
            _logger.Fatal(message());

            var logMessage = new Common.Models.LogMessage
            {
                Context  = _context,
                LogLevel = LogLevel.Fatal,
                Message  = message()
            };

            _interceptor?.Invoke(logMessage);
            _progressService.WriteMessage(logMessage.Message, PowerShellLineType.Error);
        }