logopen

Causes Tera Term to start logging.

logopen <filename> <binary flag> <append flag> [<plain text flag> [<timestamp flag> [<hide dialog flag>]]]

Remarks

Received characters are written to the file <filename>.
When the file does not include \ character, the file is saved at the TeraTerm current directory. If a user want to change the directory, use the changedir macro command.

If <binary flag> is zero, received new-line characters are converted (CR -> CR/CRLF) and escape sequences are stripped out.
If <binary flag> is non-zero, received characters are written without any modifications.

If <append flag> is non-zero and the file <filename> already exists, received characters are appended to it.
If <append flag> is zero and the file <filename> already exists, the file is overwritten.

If <plain text flag> is not 0, ASCII non-printable characters are not written into log.
If <timestamp flag> is not 0, a timestamp is added on top of log.
If <binary flag> is non-zero, <plain text flag> and <timestamp flag> is ignored.(version 4.61 or later)

If <hide dialog flag> is not 0, "Log" dialog box is not displayed.

If a log file is successfully opened, the system variable "result" is set to 0. Otherwise, the "result" is set to 1. (version 4.62 or later)

Example

connect '/C=1'

; get a user name
getenv 'USERNAME' username
; get the date and time
gettime timestr "%Y%m%d-%H%M%S"

; add the user name and the timestamp to the log file name
sprintf2 filename 'console_%s_%s.log' username timestr

; change the current directory
changedir 'C:\Documents and Settings\yutaka\desktop'

logopen filename 0 0
logwrite 'Log start'#13#10
logwrite '*****************************************************'#13#10
logclose

exit