LogEx plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
Line 51: Line 51:
==Example==
==Example==


<highlight-nsis>LogEx::Init /NOUNLOAD "$TEMP\log.txt"</highlight-nsis>
<highlight-nsis>LogEx::Init /NOUNLOAD "$TEMP\log.txt"
LogEx::Write /NOUNLOAD "Write this line to the log file only"
LogEx::Write /NOUNLOAD "Write this line to the log file and the status list box" true
LogEx::Write /NOUNLOAD "Write this line to the log file, the status list box and the statusbar" true true</highlight-nsis>


== Notes ==
== Notes ==

Revision as of 00:49, 13 February 2007

Author: jpderuiter (talk, contrib)


Links

Exe.gif [] (77 KB)

Description

Version: 0.1.

LogEx is a logging plugin. It allows to append a string to a logfile and show this string in the status listbox and/or the status bar (like DetailPrint)

How To Use

The most practical way to use this plugin is disabling the PluginUnload. To do this call "SetPluginUnload alwaysoff" in all functions and sections where you use this plugin. ...

Init DLL Function

LogEx::Init /NOUNLOAD FileName
FileName
Log file name. The file will be opened with FILE_APPEND_DATA, so evt. old data will be left untouched.

Write DLL Function

LogEx::Write /NOUNLOAD LogString [bWriteToStatusList] [bWriteToStatusBar]
LogString
String to write to the logfile.
bWriteToStatusList
If equal to true, adds the string to the Status Listbox.
bWriteToStatusBar
If equal to true, adds the string to the Status Bar.

AddFile DLL Function

LogEx::AddFile /NOUNLOAD FileName Prefix
FileName
File to add to the logfile.
Prefix
Prefix to add at the beginning of each new line.

Close DLL Function

LogEx::Close

Example

LogEx::Init /NOUNLOAD "$TEMP\log.txt"
LogEx::Write /NOUNLOAD "Write this line to the log file only"
LogEx::Write /NOUNLOAD "Write this line to the log file and the status list box" true
LogEx::Write /NOUNLOAD "Write this line to the log file, the status list box and the statusbar" true true

Notes

The LogEx::AddFile function is especially usefull in combination with execution of a console application (like ExecDos plug-in)

Version History

[version 0.1: 2007-02-12] Initial version.

JP de Ruiter