Skip to content

Commit

Permalink
Minor doc update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosak01 committed Nov 18, 2021
1 parent db3cac3 commit 4732056
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/articles/logr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vignettes/logr-faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h3>Where is my log?</h3>
<div id="nolog" class="section level3">
<h3>How come it didn’t log anything?</h3>
<p><strong>Q:</strong> I am able to create a log. But it doesn’t contain anything. Just a header and footer. How come nothing was logged?</p>
<p><strong>A:</strong> The <strong>logr</strong> log is not a fully automatic log, such as a SAS log. The primary way to get something logged is to log it explicitly with <code>log_print()</code> or <code>put()</code>. This is the only way to guarantee that something will be logged. Generally, if you want a complete log, it is best to sprinkle these functions liberally throughout the program, logging anything you feel is relevant.</p>
<p><strong>A:</strong> The <strong>logr</strong> log is not a fully automatic log, such as a SAS® log. The primary way to get something logged is to log it explicitly with <code>log_print()</code> or <code>put()</code>. This is the only way to guarantee that something will be logged. Generally, if you want a complete log, it is best to sprinkle these functions liberally throughout the program, logging anything you feel is relevant.</p>
<p>The other way to get something to log is by using the <strong>autolog</strong> feature. This feature can be turned on in one of two ways:<br />
1. Set the <code>autolog</code> parameter on the <code>log_open()</code> function to TRUE.<br />
2. Set the “logr.autolog” option using an <code>options()</code> function, like so:</p>
Expand Down Expand Up @@ -127,7 +127,7 @@ <h3>How do I add a timestamp to the log name?</h3>
</div>
<div id="code" class="section level3">
<h3>How do I log my code?</h3>
<p><strong>Q:</strong> In SAS there is an option to log all the code in my program at the top of the log. I like this because it is a good record of my program at the time it was run. Is there a similar option in <strong>logr</strong>?</p>
<p><strong>Q:</strong> In SAS® there is an option to log all the code in my program at the top of the log. I like this because it is a good record of my program at the time it was run. Is there a similar option in <strong>logr</strong>?</p>
<p><strong>A:</strong> There is not an option, but there is a <code>log_code()</code> function that will allow you to accomplish the same thing. You just call the <code>log_code()</code> function at the point where you want the code logged. Normally this would be at the top of the program, after the call to <code>log_open()</code>. Like this:</p>
<pre><code># Open log
log_open(&quot;mylog.log&quot;)
Expand All @@ -143,7 +143,7 @@ <h3>How do I log my code?</h3>
</div>
<div id="symbolgen" class="section level3">
<h3>How do I turn on symbolgen?</h3>
<p><strong>Q:</strong> In SAS there is an option called <em>symbolgen</em> that will log all the variable values in my program. This option is useful for debugging. Is there a similar option in <strong>logr</strong>?</p>
<p><strong>Q:</strong> In SAS® there is an option called <em>symbolgen</em> that will log all the variable values in my program. This option is useful for debugging. Is there a similar option in <strong>logr</strong>?</p>
<p><strong>A:</strong> Not really. You can log the values of individual variables by sending them to the log with a <code>put()</code> function. You can also log the entire environment with all variable values like this:</p>
<pre><code># Open log
log_open(&quot;test.log&quot;)
Expand All @@ -153,7 +153,7 @@ <h3>How do I turn on symbolgen?</h3>

# Close log
log_close()</code></pre>
<p>Otherwise, it is better to debug R programs interactively. The interactive debugging features in R are much better than in SAS. The <strong>logr</strong> log is geared more toward recording the execution of your program than debugging.</p>
<p>Otherwise, it is better to debug R programs interactively. The interactive debugging features in R are much better than in SAS®. The <strong>logr</strong> log is geared more toward recording the execution of your program than debugging.</p>
<p><a href="#top">top</a></p>
<hr />
</div>
Expand Down Expand Up @@ -185,7 +185,7 @@ <h3>How do I turn off the notes?</h3>
<div id="put" class="section level3">
<h3>How is put() different from log_print()?</h3>
<p><strong>Q:</strong> There is another function <code>put()</code> that seems similar to <code>log_print()</code>. What is the difference between them?</p>
<p><strong>A:</strong> There is no difference in functionality. <code>put()</code> is a direct alias of <code>log_print()</code>. The only difference is that <code>put()</code> is faster to type. It is also easy to remember for anyone who has used SAS software. The <code>put()</code> function in the <strong>logr</strong> package does the same thing as the <code>%put()</code> function in SAS. So this alias will warm the hearts of current/former SAS programmers.</p>
<p><strong>A:</strong> There is no difference in functionality. <code>put()</code> is a direct alias of <code>log_print()</code>. The only difference is that <code>put()</code> is faster to type. It is also easy to remember for anyone who has used SAS® software. The <code>put()</code> function in the <strong>logr</strong> package does the same thing as the <code>%put()</code> function in SAS®. So this alias will warm the hearts of current/former SAS® programmers.</p>
<p><a href="#top">top</a></p>
<hr />
</div>
Expand Down
1 change: 1 addition & 0 deletions vignettes/logr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ following articles:
* [Global Options](logr-globals.html)
* [Aliases for log_print()](logr-put.html)
* [tidylog Integration](logr-tidylog.html)
* [Complete Example](logr-example1.html)
1 change: 1 addition & 0 deletions vignettes/logr.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ <h3>Next Steps</h3>
<li><a href="logr-globals.html">Global Options</a></li>
<li><a href="logr-put.html">Aliases for log_print()</a></li>
<li><a href="logr-tidylog.html">tidylog Integration</a></li>
<li><a href="logr-example1.html">Complete Example</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 4732056

Please sign in to comment.