API:TextLogAddEntry
From RoR Wiki
UI Lua API · TextLog functions
Version: WAR 1.4.8
Adds a line of text to a text log.
TextLogAddEntry(logName, filterType, text)
Arguments
- logName
string– Name of the text log, for example"Chat".- filterType
number– Filter type of the entry. Cut to a whole number. For the chat logs these are the values inSystemData.ChatLogFilters.- text
wstring– The text. It must be a wide string.
Returns
Nothing.
Details
- 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. - Every LogDisplay that shows the log picks up the new entry.
Errors
Error in function call 'TextLogAddEntry': Text Log %s does not exist
Example
Printing a message to the chat window, from easystem_utils/source/mailutils.lua:
TextLogAddEntry( "Chat", SystemData.ChatLogFilters.MISC, displayString )
Filling an addon-created log, from interfacecore/source/eularocwindow.lua:
for index = 0, #StringTables.EULAROC
do
TextLogAddEntry( "EULAROCLog", 1, GetStringFromTable( "EULAROC", index ) )
end
