LDTP  3.5.0
 All Pages
startlog

Syntax

startlog('<log file name>', [[0 or 1]])

second argument is optional and 1 is default value

0 - Append log to an existing file

1 - Write log to a new file. If file already exist, then erase existing file content and start log

Description

Start logging on the specified file. Default log level set is logging.ERROR. Though this can be changed with setloglevel LDTP API.

ImplementationDetails

Log file will be created if log file is not present in any case. If second argument is 1, then existing file content will be erased. If second argument is 0, then new logs will be append to existing log.

Return values
1on Success and 0 on error

Example

If we want to overwrite existing log file or create new log file:

startlog('evolution.xml', 1)

If we want to append existing log file or create new log file:

startlog('evolution.xml', 0)

or

startlog('evolution.xml')

Author
Nagappan Alagappan nagap.nosp@m.pan@.nosp@m.gmail.nosp@m..com


Linux Desktop Testing Project