/// <summary>The on log line.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        public static void OnLogLine(object sender, LogLineEventArgs e)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender), "when calling events pass this as the first parameter");
            }

            if (e.Line.Contains("Error") || e.Line.Contains("Exception"))
            {
                Console.ForegroundColor = ConsoleColor.Red;
            }
            else if (e.Line.Contains("Information"))
            {
                Console.ForegroundColor = ConsoleColor.Blue;
            }
            else if (e.Line.Contains("Debug"))
            {
                Console.ForegroundColor = ConsoleColor.Green;
            }
            else if (e.Line.Contains("Extended Properties"))
            {
                Console.ForegroundColor = ConsoleColor.White;
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Gray;
            }

            Console.WriteLine(e.Line);
        }
Beispiel #2
0
        /// <summary>The on log line.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        public static void OnLogLine(object sender, LogLineEventArgs e)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender), "when calling events pass this as the first parameter");
            }

            if (e.Line.Contains("Error") || e.Line.Contains("Exception"))
            {
                Console.ForegroundColor = ConsoleColor.Red;
            }
            else if (e.Line.Contains("Information"))
            {
                Console.ForegroundColor = ConsoleColor.Blue;
            }
            else if (e.Line.Contains("Debug"))
            {
                Console.ForegroundColor = ConsoleColor.Green;
            }
            else if (e.Line.Contains("Extended Properties"))
            {
                Console.ForegroundColor = ConsoleColor.White;
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Gray;
            }

            Console.WriteLine(e.Line);
        }
Beispiel #3
0
        /// <summary>The on log line.</summary>
        /// <param name="args">The args.</param>
        private void OnLogLine(LogLineEventArgs args)
        {
            var local = this.LogLine;

            if (local != null)
            {
                local(this, args);
            }
        }
 /// <summary>The on log line.</summary>
 /// <param name="args">The args.</param>
 private void OnLogLine(LogLineEventArgs args)
 {
     var local = this.LogLine;
     if (local != null)
     {
         local(this, args);
     }
 }