<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Logging%3AEnable_Logs_Quickly</id>
	<title>Logging:Enable Logs Quickly - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Logging%3AEnable_Logs_Quickly"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Logging:Enable_Logs_Quickly&amp;action=history"/>
	<updated>2026-04-25T16:53:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Logging:Enable_Logs_Quickly&amp;diff=24860&amp;oldid=prev</id>
		<title>Fishermans: /* Using these macros */</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Logging:Enable_Logs_Quickly&amp;diff=24860&amp;oldid=prev"/>
		<updated>2016-10-26T10:24:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Using these macros&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:24, 26 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!macro LogTextMacro INPUT_TEXT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!macro LogTextMacro INPUT_TEXT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   !ifdef ENABLE_LOGGING&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   !ifdef ENABLE_LOGGING&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     LogText $INPUT_TEXT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     LogText $&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{&lt;/ins&gt;INPUT_TEXT&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   !endif&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   !endif&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!macroend&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!macroend&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-23095:rev-24860 --&gt;
&lt;/table&gt;</summary>
		<author><name>Fishermans</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Logging:Enable_Logs_Quickly&amp;diff=23095&amp;oldid=prev</id>
		<title>Shayashi: Created page</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Logging:Enable_Logs_Quickly&amp;diff=23095&amp;oldid=prev"/>
		<updated>2013-03-08T23:40:39Z</updated>

		<summary type="html">&lt;p&gt;Created page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageAuthor|SHayashi}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
LogOn and LogText are very useful debugging tools for your installer.  Unfortunately, if you have a bunch of LogText lines spread throughout your code, it makes it very difficult to remove.  This set of macros allows you to turn logging on and off with a single statement.&lt;br /&gt;
&lt;br /&gt;
Note: It&amp;#039;s assumed you know about the [[Special_Builds|NSIS Special Builds]], which enable the LogOn and LogText commands.  The standard NSIS build will throw errors if you attempt to use LogOn or LogText directly.  These macros will fix this.&lt;br /&gt;
&lt;br /&gt;
====Original Logging example====&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
OutFile &amp;quot;Installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start; every NSIS script has at least one section.&lt;br /&gt;
section&lt;br /&gt;
LogText &amp;quot;Some Logging Text Here&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
Function .onInit&lt;br /&gt;
  SetOutPath $INSTDIR&lt;br /&gt;
  LogSet on&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
====Using these macros====&lt;br /&gt;
If you need to enable logging, just define ENABLE_LOGGING.  If you&amp;#039;re using the standard non-logging NSIS build, just comment out ENABLE_LOGGING.&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!define ENABLE_LOGGING&lt;br /&gt;
&lt;br /&gt;
!include &amp;quot;logging.nsh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# name the installer&lt;br /&gt;
OutFile &amp;quot;Installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start; every NSIS script has at least one section.&lt;br /&gt;
section&lt;br /&gt;
${LogText} &amp;quot;Some Text Here&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
Function .onInit&lt;br /&gt;
  SetOutPath $INSTDIR&lt;br /&gt;
  ${LogSet} on&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the macro file logging.nsh:&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!define LogSet &amp;quot;!insertmacro LogSetMacro&amp;quot;&lt;br /&gt;
!macro LogSetMacro SETTING&lt;br /&gt;
  !ifdef ENABLE_LOGGING&lt;br /&gt;
    LogSet ${SETTING}&lt;br /&gt;
  !endif&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!define LogText &amp;quot;!insertmacro LogTextMacro&amp;quot;&lt;br /&gt;
!macro LogTextMacro INPUT_TEXT&lt;br /&gt;
  !ifdef ENABLE_LOGGING&lt;br /&gt;
    LogText $INPUT_TEXT&lt;br /&gt;
  !endif&lt;br /&gt;
!macroend&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Written by [[user:SHayashi]]&lt;br /&gt;
&lt;br /&gt;
Inspired by [[Logging:_Simple_Text_File_Logging_Functions_and_Macros]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Logging Functions]]&lt;/div&gt;</summary>
		<author><name>Shayashi</name></author>
	</entry>
</feed>