Differences between revisions 7 and 8
Revision 7 as of 2023-06-08 01:07:16
Size: 750
Comment:
Revision 8 as of 2023-06-08 20:30:12
Size: 1132
Comment:
Deletions are marked like this. Additions are marked like this.
Line 51: Line 51:
== Stored Results ==

`log` stores the following details:

 * log name in `r(name)`
 * log filename in `r(filename)`
 * logging status (on or off) in `r(status)`
 * log type (smcl or text) in `r(type)`

`log query _all` stores the number of open logs in `r(numlogs)`. For each open log, it stores the above details as e.g. `r(name1)`, `r(name2)`, and so on.

----


Line 53: Line 68:
[[https://www.stata.com/manuals/dlog.pdf|Stata manual for log]] [[https://www.stata.com/manuals/rlog.pdf|Stata manual for log]]

Stata Log

The log command records commands and command output, and writes them to a log file.


Usage

Rich Logs

Stata supports a rich log format, using the .smcl file extension.

log using "path/to/file.smcl", replace
log close

Text Logs

Use the text option.

log using "path/to/file.txt", replace text
log close


Temporarily Disabling Logging

Some output should not be recorded. Try:

log off
display "Rather than running commands quietly, temporarily turn off logging.
log on


Stored Results

log stores the following details:

  • log name in r(name)

  • log filename in r(filename)

  • logging status (on or off) in r(status)

  • log type (smcl or text) in r(type)

log query _all stores the number of open logs in r(numlogs). For each open log, it stores the above details as e.g. r(name1), r(name2), and so on.


See also

Stata manual for log


CategoryRicottone

Stata/Log (last edited 2023-06-09 13:49:49 by DominicRicottone)