write to logfile # <Var/Number> append =<Var/Number> value =<Value>

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

write to logfile # <Var/Number> append =<Var/Number> value =<Value>

Post by mark_a_condren » Mon, 20. Sep 10, 13:00

write to logfile # <Var/Number> append = <Var/Number> value = <Value>


<Var/Number> = The log file number that will be written to. If this does not exsist it will be created.
<Var/Number> = Set this value to [TRUE] / [FALSE], or their numerical equivalent of (1) / (0) respectively. Or, a variable containing one of these values.
<Value> = What is to be written to the log file.


Writes <Value> to an external file named logNNNNN.txt where NNNNN is the number specified in 'logfile # <Var/Number>'.

If logfile # = null, nothing at all will be written. This can be useful for debugging.

If append is [TRUE], then the value is added to the end of the log file.
If append is [FALSE], then the contents of the log file are replaced with <Value>.


Example:

The following might be used at the start of a 'Debug' log.

$playing.time = playing time
$fmt.playing.time = format time: $playing.time
$log.message = sprintf: fmt = 'Debug started at playing time = %s', $fmt.playing.time, null, null, null, null
write to logfile # 9999 append =[TRUE] value =$log.message

This would add the following message to the log file, 'Debug started at playing time = 12:34:56'. It would be 'added' due to 'append =[TRUE]'.


Command Location:

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

[TiP][49] 287271

Post by X2-Illuminatus » Thu, 14. Oct 10, 19:02

write to logfile # <Var/Number> append = <Var/Number> value = <Value>


<Var/Number> = Die Nummer der Log-Datei, in die geschrieben werden soll. Falls sie nicht existiert, wird sie erstellt.
<Var/Number> = Setze dies auf [TRUE] (wahr) / [FALSE] (falsch), oder auf ihre numerischen Äquivalente (1) / (0). Oder auf eine Variable, die einen dieser Werte enthält.
<Value> = Was in die Log-Datei geschrieben werden soll.


Schreibt <Value> in eine externe Datei mit dem Namen 'logNNNNN.txt', wobei 'NNNNN', die in 'logfile # <Var/Number>' festgelegte Zahl ist.

Wenn logfile # = null ist, wird überhaupt nichts geschrieben. Dies kann zum Debuggen nützlich sein.

Wenn append [TRUE] ist, wird der Wert ans Ende der Log-Datei geschrieben.
Wenn append [FALSE] ist, wird der Inhalt der Log-Datei mit <Value> ersetzt.


Beispiel:

Das folgende wird möglicherweise am Anfang eines "Debug"-Logs genutzt:

$playing.time = playing time
$fmt.playing.time = format time: $playing.time
$log.message = sprintf: fmt = 'Debug started at playing time = %s', $fmt.playing.time, null, null, null, null
write to logfile # 9999 append =[TRUE] value =$log.message

Dies würde die folgende Nachricht in die Log-Datei schreiben: 'Debug started at playing time = 12:34:56'. Es würde aufgrund von 'append =[TRUE]' hinzugefügt werden.


Zu finden unter:

Locked

Return to “MSCI Reference”