Print of logs: |
ASM has two mechanisms for generating the logs.
1) Automatic log's generation. Automatic log's generation consists of the following. ASM intercepts all calls of UO.Print(Text) and consecutively are written the lines 'Text' into the text file. Automatic log's generation is switch off in default. In order to include automatic log's generation you should appropriate to the parameter AutoLogFileName the name of the file, in which will be written to log file. But in order to switch off - to assign a value "0". Before the start it is possible to a little dispose the system of automatic log's generation through the set of the parameters: AutoLogTimeNeed, AutoLogDateNeed, AutoLogTimeFormat, AutoLogDateFormat, AutoLogDivider. All parameters are in detail described in the appropriate division of documentation. 2) Manual log's generation. Log's generation also can be forced. This is useful in the case of the work of several scripts, which must write reports into different files. For similar forced log's generation is used the function asmLogAdd(). The first method possesses large convenience in the use and it makes it possible to easily switch off log's generation. The second method more flexible allows more than possibilities. asmLogAdd(string FileName, string Text) Function writes into the end of the file 'FileName' the line 'Text'. Example 1:
UO.asmSetOption('AutoLogDateNeed','0')
Example 2:UO.asmSetOption('AutoLogTimeNeed','1') UO.asmSetOption('AutoLogTimeFormat','hh:nn:ss') UO.asmSetOption('AutoLogFileName','logfile.txt') For Var F = 0 To 9 UO.Print('String number '+STR(F)) Next UO.asmSetOption('AutoLogFileName','0')
For Var F = 0 To 9
UO.asmLogAdd('logfile.txt', UO.asmGetTime('hh:nn:ss')+' > String number '+STR(F)) Next |