API:TextLogAddSingleByteEntry
From RoR Wiki
UI Lua API · TextLog functions
Version: WAR 1.4.8
Adds a line of text to a text log, taking the text as an ordinary Lua string.
TextLogAddSingleByteEntry(logName, filterType, text)
Arguments
- logName
string– Name of the text log.- filterType
number– Filter type of the entry. Cut to a whole number.- text
string– The text, as a plain Lua string (not a wide string).
Returns
Nothing.
Details
- This is TextLogAddEntry for single-byte text. Each byte of
textbecomes one character; there is no UTF-8 decoding, so only plain ASCII text comes out as written. - The text is cut to 1023 characters.
- Nothing is added if the log is disabled (TextLogSetEnabled) or if the entry's filter type is switched off in the log.
- If the log already holds as many entries as its entry limit, the oldest entries are removed first. A log with an entry limit of 0 stores nothing.
- In the text,
<BR>and<br>become a line break and<P>and<p>become two line breaks. - The entry is stamped with the local time (shown by LogDisplaySetShowTimestamp and returned by TextLogGetEntry).
- If incremental saving is on (see TextLogSetIncrementalSaving), the entry is also written to the log file as
[YY/MM/DD][HH:MM:SS]followed by the filter name and the text, with nothing between them. - The log's update event (see TextLogGetUpdateEventId) fires with
SystemData.TextLogUpdate.ADDEDand the filter type. - The stock UI never calls this function.
Errors
Error in function call 'TextLogAddEntry': Text Log %s does not exist
The message namesTextLogAddEntry, not this function.
Example
A minimal example built from the signature above:
TextLogAddSingleByteEntry( "Chat", SystemData.ChatLogFilters.MISC, "Hello" )
