Howto: turn on logging in Project White

Note: After moving my code, this wasn’t enough anymore, I did some additional changes.

Of course I ran into an issue: on one MDI child window I couldn’t find any components but on another it worked fine. I gave myself the task to try the built in logging funtion.

This is how you set it up when you are running Visual Studios testrunner.

To begin with, find you’ll find the file log4net.config in the installation folder for White.

Copy it to the root folder of your test project (where all the code to your tests are).

In Visual Studio, select your project, right click and choose “Add”->”Existing Item”. Make sure “All files” is selected. Choose log4net.config from the list.

Now,  click on the file in Visual Studio and look at it’s properties.
You should set them so that it says “Build Action: content” and “Copy to output directory: copy always”.

After that, add window.LogStructure() in the test where you want to do the logging. Of course, replace “window” with the name of your window.

Build the project, run the test and a log file should have been created.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s