MapTrip SDK Android Manual 9.9.7
Logging Class Reference

This class provides logging functionality for the SDK's internal processes.
More...

Static Public Member Functions

static native ApiError configureLogCategory (String category, int loglevel)
 
static native ApiError disableDebugLogging ()
 
static native ApiError disableFileLogging ()
 
static native ApiError enableDebugLogging ()
 
static native ApiError enableFileLogging (String filename, int maxSize, int maxFiles, boolean closeFileMode)
 
static native ApiError write (int loglevel, String msg)
 
static native ApiError writeWithCategory (String category, int loglevel, String msg)
 

Detailed Description

This class provides logging functionality on different outputs like files or the standard output. Each log entry consists of a category, a log level and the logmessage.
This SDK allows to write logmessages with the category "APPLICATION" at different loglevels. The logger can be configured to log only messages up to a specified loglevel for a certain category.
Example:
Logging.configureLogCategory("APLICATION", 23);
Logging.configureLogCategory("API", 23);
Logging.configureLogCategory("CALLBACK", 23);
Logging.configureLogCategory("APIINIT", 23);
Logging.configureLogCategory("LICENCE", 23);
Logging.enableDebugLogging();
Logging.enableFileLogging(filename, 1024*1024*10 , 5, false);

Member Function Documentation

◆ configureLogCategory()

static native ApiError configureLogCategory ( String  category,
int  loglevel 
)
static

Configures for a given category, the maximum loglevel that a message may have so that it is included in the logoutput.

Parameters
categorydefines the category for which the loglevel is configured.
logleveluser defined loglevels or Loglevel if wanted.
Returns
Errorcode

◆ disableDebugLogging()

static native ApiError disableDebugLogging ( )
static

Disable debug logging functionality

Returns
Errorcode

◆ disableFileLogging()

static native ApiError disableFileLogging ( )
static

Disable logging functionality which writes to a file on disk.

Returns
Errorcode

◆ enableDebugLogging()

static native ApiError enableDebugLogging ( )
static

Enable debug logging functionality which generates log output in the standard output

Returns
Errorcode

◆ enableFileLogging()

static native ApiError enableFileLogging ( String  filename,
int  maxSize,
int  maxFiles,
boolean  closeFileMode 
)
static

Enable logging functionality which writes to one or multiple files on disk.

Parameters
filenamein which log data is stored. The name gets an automatic postfix, which is a 3 digit ascending index starting with 000
maxSizedefines the maximum size of a logfile in bytes. If a new log entry would exceed maxSize of the current logfile, it will be written in the log file with the next higher index.
maxFilesdefines the maximum number of logfiles that shall be written. If a new log entry would exceed maxSize in the logfile with index maxFiles, logging will continue in the first file and overwrite it from the beginning.
closeFileModeif true, the logfile will be closed after a new log entry is written
Returns
Errorcode

◆ write()

static native ApiError write ( int  loglevel,
String  msg 
)
static

If the loglevel of the category "APPLICATION" (set with by Logging.configureLogCategory().) is < than the param loglevel, msg is written to the logoutput.

Parameters
logleveldefines the level with which msg is written.
msgdefines the logmessage itself.
Returns
Errorcode

◆ writeWithCategory()

static native ApiError writeWithCategory ( String  category,
int  loglevel,
String  msg 
)
static

If the loglevel of the category "APPLICATION" (set with by Logging.configureLogCategory().) is < than the param loglevel, msg is written to the logoutput.

Parameters
logleveldefines the level with which msg is written.
msgdefines the logmessage itself.
Returns
Errorcode

The documentation for this class was generated from the following file: