<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.bci2000.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Programming_Reference%3ALogFile_Class</id>
	<title>Programming Reference:LogFile Class - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.bci2000.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Programming_Reference%3ALogFile_Class"/>
	<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:LogFile_Class&amp;action=history"/>
	<updated>2026-06-24T15:57:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:LogFile_Class&amp;diff=3879&amp;oldid=prev</id>
		<title>Mellinger at 13:57, 19 June 2008</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:LogFile_Class&amp;diff=3879&amp;oldid=prev"/>
		<updated>2008-06-19T13:57:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Location==&lt;br /&gt;
&amp;lt;tt&amp;gt;BCI2000/src/shared/utils&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Synopsis==&lt;br /&gt;
The &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; class transparently handles output into a log file. The output log file is maintained in the current [[BCI2000_Glossary#Session|session directory]], and carries the session name, followed with a user-specified extension. The log file&amp;#039;s contents are never overwritten; rather, new entries are appended to it.&lt;br /&gt;
Creating an instance of &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; and writing to it is sufficient to create a log file at an appropriate location; no further programmer interaction is required.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; class inherits from &amp;lt;tt&amp;gt;std::ofstream&amp;lt;/tt&amp;gt; and provides the full interface of STL &amp;lt;tt&amp;gt;ostreams&amp;lt;/tt&amp;gt;, allowing to use convenient output notation as in&lt;br /&gt;
 myLogFile &amp;lt;&amp;lt; &amp;quot;Run number &amp;quot; &amp;lt;&amp;lt; runNumber &amp;lt;&amp;lt; &amp;quot; started.&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
===LogFile(string FileExtension=&amp;quot;.log&amp;quot;)===&lt;br /&gt;
When creating a &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; object, specify the desired file extension as a string argument. Typically, the specified extension begins with a separating dot. By default, &amp;lt;tt&amp;gt;.log&amp;lt;/tt&amp;gt; is chosen as a file extension.&lt;br /&gt;
&lt;br /&gt;
==Remarks==&lt;br /&gt;
When writing a BCI2000 application module, it is recommended to use the [[Programming Reference:ApplicationBase Class|&amp;lt;tt&amp;gt;ApplicationBase&amp;lt;/tt&amp;gt;]] class as a base class for the application&amp;#039;s task filter. In this case, dealing with a &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; object is not necessary; rather, the &amp;lt;tt&amp;gt;ApplicationBase&amp;lt;/tt&amp;gt; class provides a &amp;lt;tt&amp;gt;LogFile&amp;lt;/tt&amp;gt; object that is tied to a [[Programming Reference:GenericVisualization Class]] object such that output will be written to the screen and to a log file simultaneously. For details, refer to [[Programming Reference:ApplicationBase Class]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[Programming Reference:ApplicationBase Class]], [[Programming Reference:Debug Output]], [[Programming Reference:Errors and Warnings]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Framework API]][[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mellinger</name></author>
	</entry>
</feed>