Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C#
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
ConsoleMirror
.gitignore
ConsoleMirror.sln
Package.nuspec
readme.md

readme.md

ConsoleMirror by AppHarbor

ConsoleMirror is a simple utility that allows you to capture the console output of Console.Write() and Console.WriteLine() calls within your .NET console applications.

Installation

ConsoleMirror is available on NuGet and works on .NET 2.0+

Sample usage

    using System;
    using NLog;

    namespace WorkerDemo
    {
        class Program
        {
            private static Logger logger = LogManager.GetCurrentClassLogger();
            static void Main(string[] args)
            {
                ConsoleMirror.Initialize();

                try
                {
                    Console.WriteLine("Hello world!");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.StackTrace);
                }

                logger.Info(ConsoleMirror.Captured);
            }
        }
    }

The output is both captured into ConsoleMirror.Captured as well as displayed on the screen.

Something went wrong with that request. Please try again.