LDTP
2.3.1
|
startlog('<log file name>', [[0 or 1], ['<screenshot directory>']])
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
Screenshot files has to be placed in screenshot directory
Start logging on the specified file. Default log level set is logging.WARNING. Though this can be changed with setloglevel LDTP API.
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.
1 | on Success and 0 on error |
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')
or
startlog('~/evolution.xml', screenshotdir = '~/screenshot') evolution.xml log file will ge generated in home directory of current user and the screenshot files will be placed screenshot folder of current user's home directory.