Mercurial > projects > ldc
comparison tango/example/logging/chainsaw.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 import tango.core.Thread; | |
2 | |
3 import tango.util.log.Log, | |
4 tango.util.log.Log4Layout, | |
5 tango.util.log.SocketAppender; | |
6 | |
7 import tango.net.InternetAddress; | |
8 | |
9 | |
10 /******************************************************************************* | |
11 | |
12 Hooks up to Chainsaw for remote log capture. Chainsaw should be | |
13 configured to listen with an XMLSocketReciever | |
14 | |
15 *******************************************************************************/ | |
16 | |
17 void main() | |
18 { | |
19 // get a logger to represent this module | |
20 auto logger = Log.getLogger ("example.chainsaw"); | |
21 | |
22 // hook up an appender for XML output | |
23 logger.addAppender (new SocketAppender (new InternetAddress("127.0.0.1", 4448), new Log4Layout)); | |
24 | |
25 while (true) | |
26 { | |
27 logger.info ("Hello Chainsaw!"); | |
28 Thread.sleep (1.0); | |
29 } | |
30 } |