Persistentdata for beginners: File Logger

File Logger provides logging to file for the purposes of debugging and field testing. It was developed as an internal logging framework for communication-related components, but over time it was used throughout the Symbian platform.

File Logger uses a client-server architecture, and provides a simple API to log to file as defined by the RFileLogger class (flogger.h). Client code should link to flogger.lib.

Static and non-static versions of the logging methods are provided for convenience. The static version is slower to use than the non-static version because it needs to reconnect to the server each time data is logged.

Logs can be enabled and disabled without having to re-compile by creating the directory you specify in your logging code under the C:\Logs directory (or on the emulator \epoc32\winscw\c\Logs). File Logger also provides a patchable constant to select logging using RDebug::Print.

The log output looks like this (excerpt from mmswatcher log):

29/01/2010 7:15:00 End of ConstructL
29/01/2010 7:15:48 RunL (iStatus = 0)
29/01/2010 7:15:48 DoRunL, state == 1
29/01/2010 7:15:48 StartupL
29/01/2010 7:15:48 Opening session

Further resources

Coming up next…
RFile Logger is next in the Persistentdata for beginners series.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: