Skip to content

Loggers

DurieuxPol edited this page Apr 10, 2024 · 4 revisions

Loggers are objects that give feedback on the state of the analysis. They print a message for each step of the analysis, and are especially useful when an error occurs.
There are 3 loggers for the moment:

MTNullLogger

This logger is an empty one, it doesn't log anything.
To use it:

analysis logger: MTNullLogger new

MTFileLogger

This logger fills a file with its logging information. You just need to give it a name for the file, and it will create it and fills it.
To log into a file named "log.txt":

analysis logger: (MTFileLogger toFileNamed: 'log.txt')

MTTranscriptLogger

This is the default logger used by the analysis.
This logger does the same as the one above, but fills the transcript of Pharo instead.
To use this logger:

analysis logger: MTTranscriptLogger new