1 |
maya |
332 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
|
|
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
maya |
571 |
<html> |
4 |
|
|
<head> |
5 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
6 |
|
|
<title>logopen</title> |
7 |
|
|
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
|
|
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
|
|
</head> |
10 |
yutakakn |
206 |
|
11 |
maya |
571 |
<body> |
12 |
yutakakn |
206 |
|
13 |
|
|
|
14 |
maya |
571 |
<h1>logopen</h1> |
15 |
yutakakn |
206 |
|
16 |
maya |
571 |
<p> |
17 |
|
|
Causes Tera Term to start logging. |
18 |
|
|
</p> |
19 |
yutakakn |
206 |
|
20 |
maya |
571 |
<pre class="macro-syntax"> |
21 |
maya |
774 |
logopen <filename> <binary flag> <append flag> [<plain text flag> [<timestamp flag> [<hide dialog flag>]]] |
22 |
yutakakn |
206 |
</pre> |
23 |
|
|
|
24 |
maya |
571 |
<h2>Remarks</h2> |
25 |
yutakakn |
206 |
|
26 |
maya |
571 |
<p> |
27 |
yutakapon |
1007 |
Received characters are written to the file <filename>.<br> |
28 |
yutakapon |
1013 |
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 <a href="changedir.html">changedir</a> macro command. |
29 |
maya |
571 |
</p> |
30 |
|
|
|
31 |
|
|
<p> |
32 |
|
|
If <binary flag> is zero, received new-line characters are converted (CR -> CR/CRLF) and escape sequences are stripped out.<br> |
33 |
|
|
If <binary flag> is non-zero, received characters are written without any modifications. |
34 |
|
|
</p> |
35 |
|
|
|
36 |
|
|
<p> |
37 |
maya |
774 |
If <append flag> is non-zero and the file <filename> already exists, received characters are appended to it.<br> |
38 |
|
|
If <append flag> is zero and the file <filename> already exists, the file is overwritten. |
39 |
|
|
</p> |
40 |
maya |
571 |
|
41 |
maya |
778 |
<p> |
42 |
maya |
1106 |
If <plain text flag> is not 0, ASCII non-printable characters are not written into log.<br> |
43 |
|
|
If <timestamp flag> is not 0, a timestamp is added on top of log.<br> |
44 |
|
|
If <hide dialog flag> is not 0, "Log" dialog box is not displayed. |
45 |
maya |
774 |
</p> |
46 |
|
|
|
47 |
maya |
1170 |
<p> |
48 |
yutakapon |
1171 |
If a log file is successfully opened, the system variable "result" is set to 0. Otherwise, the "result" is set to 1. <em>(version 4.62 or later)</em> |
49 |
maya |
1170 |
</p> |
50 |
maya |
571 |
|
51 |
|
|
<h2>Example</h2> |
52 |
|
|
|
53 |
|
|
<pre class="macro-example"> |
54 |
yutakapon |
1007 |
connect '/C=1' |
55 |
|
|
|
56 |
|
|
; get a user name |
57 |
|
|
getenv 'USERNAME' username |
58 |
|
|
; get the date and time |
59 |
|
|
gettime timestr "%Y%m%d-%H%M%S" |
60 |
|
|
|
61 |
|
|
; add the user name and the timestamp to the log file name |
62 |
yutakapon |
1087 |
sprintf2 filename 'console_%s_%s.log' username timestr |
63 |
yutakapon |
1007 |
|
64 |
yutakapon |
1013 |
; change the current directory |
65 |
|
|
changedir 'C:\Documents and Settings\yutaka\desktop' |
66 |
|
|
|
67 |
yutakapon |
1007 |
logopen filename 0 0 |
68 |
|
|
logwrite 'Log start'#13#10 |
69 |
|
|
logwrite '*****************************************************'#13#10 |
70 |
|
|
logclose |
71 |
|
|
|
72 |
|
|
exit |
73 |
maya |
1034 |
</pre> |
74 |
maya |
571 |
|
75 |
|
|
</body> |
76 |
|
|
</html> |