SfwServiceLogger Class Reference

#include <mw/cwrt/sfwservicelogger.h>

class SfwServiceLogger

A logging utility class for service providers.

Public Member Functions
SfwServiceLogger(const char *)
voidlog(const char *, ...)
boolsetLogFile(const char *)

Detailed Description

This utlity class is intended to be intantiated by service providers to output messages to debug console(all platform) and to a log file(Symbian only) in the file system. The folder containing the log file has been hard-coded to "sfw" and it's realtive to c:\ (i.e. the log file will be saved in c:). The user can set the name of the log file when instantiating this utility class, however, if no name is specified(i.e. if default constructor is used), messages will only be printed to debug console. Logging messages to a file is only supported in Symbian platform, but messages will be printed to debug console in all platforms.

Constructor & Destructor Documentation

SfwServiceLogger ( )


Default constructor

SfwServiceLogger ( const char * )

SfwServiceLogger(const char *aFileName)[inline]

Constructs a utility object, connects to RFileLogger, and creates a log file. This constructor is intended to be used in Symiban only.

aFileNamename of the log file

~SfwServiceLogger ( )



Member Function Documentation

lastLogError ( )


Returns the last error status that has been set. Symbian only.

Return Value
error number of last error

log ( const char *, ... )

voidlog(const char *text,

Outputs messages to debug console for all platforms. Writes messages to a log file(Symbian only).

textthe format string to be printed

logValid ( )


Returns the status of the log. Symbian only.

Return Value
true if log is valid, false otherwise

setLogFile ( const char * )

boolsetLogFile(const char *aFileName)[inline]

Creates a log file with specified file name. If a log file already exists, old content won't be erased. Only intended to be used in Symbian.

aFileNamename of the log file to be created