. .

st4u

ST 4U 214: Logging with Toothpick

April 2, 2012 10:28:31.039

Today's Smalltalk 4 You looks at logging with Toothpick in VisualWorks and Pharo (the code is available for VA, and Dolphin as well - and the VW code works in ObjectStudio, while the Squeak code is what I used in Pharo). If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Logging

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

The logging code used in the screencast, which you can find documented at metaprog:


"create a logger"
logger1 := TranscriptLogger new
			name: 'My first Logger'.

"where do logging events go"
logger1 format: SimpleLoggingFormatter defaultFormat.

"logging policy"
logger1 policy: (LoggingPolicy category: #debug level: #debug).

"register the logger"
(LoggingMultiplexer current)
	addLogger: logger1.

"Start the loggers"
(LoggingMultiplexer current) startAllLoggers.

LoggingEvent 
	category: #debug 
	level: #warn 
	message: 'using obsolete protocol'.

LoggingMultiplexer current stopAllLoggers

Technorati Tags: , ,

Enclosures:
[st4u214-iPhone.m4v ( Size: 6126431 )]

posted by James Robertson

 Share Tweet This