Пример #1
0
        public void LogWarning(string message, params object[] messageArgs)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                Message     = message,
                MessageArgs = messageArgs
            };

            _cmdlet.WriteWarning(logEntry.ToString());
        }
Пример #2
0
        public void EndSection(string message, params object[] messageArgs)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                Message     = message,
                MessageArgs = messageArgs
            };

            _cmdlet.WriteVerbose(logEntry.ToString());
        }
Пример #3
0
        public void LogMessage(MessageType type, string message, params object[] messageArgs)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                MessageType = type.ToString(),
                Message     = message,
                MessageArgs = messageArgs
            };

            _cmdlet.WriteVerbose(logEntry.ToString());
        }
Пример #4
0
        public void LogErrorFromException(Exception ex)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                Exception = ex
            };

            var exception = new InvalidOperationException(logEntry.ToString());

            _cmdlet.WriteError(new ErrorRecord(exception, null, ErrorCategory.InvalidOperation, null));
        }
Пример #5
0
        public void LogError(string message, params object[] messageArgs)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                Message     = message,
                MessageArgs = messageArgs
            };

            var exception = new InvalidOperationException(logEntry.ToString());

            _cmdlet.WriteError(new ErrorRecord(exception, null, ErrorCategory.InvalidOperation, null));
        }
Пример #6
0
        public void LogWarning(string file, int lineNumber, int linePosition, string message, params object[] messageArgs)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                File         = file,
                LineNumber   = lineNumber,
                LinePosition = linePosition,
                Message      = message,
                MessageArgs  = messageArgs
            };

            _cmdlet.WriteWarning(logEntry.ToString());
        }
Пример #7
0
        public void LogErrorFromException(Exception ex, string file, int lineNumber, int linePosition)
        {
            var logEntry = new PsXdtConfigTransformLogEntry()
            {
                File         = file,
                Exception    = ex,
                LineNumber   = lineNumber,
                LinePosition = linePosition
            };

            var exception = new InvalidOperationException(logEntry.ToString());

            _cmdlet.WriteError(new ErrorRecord(exception, null, ErrorCategory.InvalidOperation, null));
        }