<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATextLogLoadFromFile</id>
	<title>API:TextLogLoadFromFile - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATextLogLoadFromFile"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TextLogLoadFromFile&amp;action=history"/>
	<updated>2026-10-17T15:56:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:TextLogLoadFromFile&amp;diff=30788&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TextLogLoadFromFile&amp;diff=30788&amp;oldid=prev"/>
		<updated>2026-10-16T19:50:08Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=TextLog}}&lt;br /&gt;
Reads a UTF-16 log file and adds each line to a text log as a new entry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TextLogLoadFromFile(logName, fileName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;logName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the text log to add the lines to.&lt;br /&gt;
;fileName : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Path of the file. It must be inside the client&amp;#039;s log directory.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The file must start with a UTF-16 byte-order mark. Otherwise the &amp;#039;&amp;#039;is not a valid unicode log file&amp;#039;&amp;#039; error is raised.&lt;br /&gt;
* The file is split at line feeds. Each line is added as if by [[API:TextLogAddEntry|TextLogAddEntry]] with filter type &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, so the usual rules apply: the entry limit, the enabled flag, the update event and incremental saving.&lt;br /&gt;
* The whole line becomes the entry text. A file written by incremental saving therefore gives entries that start with the saved date, time and filter name, and that end with the carriage return written before each line feed.&lt;br /&gt;
* If incremental saving to the same log is on, the loaded lines are written to the log&amp;#039;s file again.&lt;br /&gt;
* If the file does not exist, nothing is loaded.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.&lt;br /&gt;
* The stock UI never calls this function.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;TextLogLoadFromFile&amp;#039;: Text Log %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;TextLogLoadFromFile&amp;#039;: File &amp;#039;%s&amp;#039; is not in the log directory &amp;#039;%s&amp;#039;.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;TextLogLoadFromFile&amp;#039;: File &amp;#039;%s&amp;#039; is not a valid unicode log file.&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This message is formatted as a narrow string while the file name is a wide string, so usually only the first character of the name appears.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A minimal example built from the documented signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TextLogCreate( &amp;quot;OldLog&amp;quot;, 1000 )&lt;br /&gt;
TextLogLoadFromFile( &amp;quot;OldLog&amp;quot;, L&amp;quot;logs/uilog.log&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:TextLogSetIncrementalSaving|TextLogSetIncrementalSaving]]&lt;br /&gt;
* [[API:TextLogAddEntry|TextLogAddEntry]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>