⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 log.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 16mar2005}{...}
{cmd:help log}, {cmd:help cmdlog}{right:dialog:  {bf:{dialog log_dlg:log}}}
{cmd:help set logtype}, {cmd:help set linesize}
{hline}

{title:Title}

{p2colset 5 16 18 2}{...}
{p2col :{hi:[R] log} {hline 2}}Echo copy of session to file or device{p_end}
{p2colreset}{...}


{title:Syntax}

{phang}
Report status of log file

{p 8 13 2}
{opt lo:g}

{phang}
Open log file

{p 8 13 2}
{opt lo:g} {cmd:using} {it:filename} [{cmd:,} {cmd:append}
{cmd:replace} [{opt t:ext}{c |}{opt s:mcl}]]

{phang}
Close log, temporarily suspend logging, or resume logging

{p 8 13 2}
{opt lo:g} {c -(}{opt c:lose}{c |}{opt of:f}{c |}{opt on}{c )-}

{phang}
Report status of command log file

{p 8 16 2}
{cmd:cmdlog}

{phang}
Open command log file

{p 8 16 2}
{cmd:cmdlog} {cmd:using} {it:filename} [{cmd:,} {cmd:append} {cmd:replace}]

{phang}
Close command log, temporarily suspend logging, or resume logging

{p 8 16 2}
{cmd:cmdlog} {c -(}{opt c:lose}{c |}{opt on}{c |}{opt of:f}{c )-}

{phang}
Set default format for logs

{p 8 16 2}
{cmd:set logtype} {c -(}{opt t:ext}{c |}{opt s:mcl}{c )-}
[{cmd:,} {opt perm:anently}]

{phang}
Specify screen width

{p 8 16 2}
{ul:{cmd:set}} {opt li:nesize} {it:#}

{phang}
If {it:filename} is specified without an extension, one of the suffixed
{cmd:.smcl}, {cmd:.log}, or {cmd:.txt} is added.

{pmore}
The extension {cmd:.smcl} or {cmd:.log} is added by {cmd:log}, depending on
whether the file format is SMCL or ASCII text.

{pmore}
The extension {cmd:.txt} is added by {cmd:cmdlog}.

{phang}
In addition to using the {cmd:log} command, you may access the capabilities of
{cmd:log} by selecting {bf:File > Log}.

{phang}
Note:  If {it:filename} contains embedded spaces, remember to enclose it in
double quotes. 


{title:Description}

{pstd}
{cmd:log} allows you to make a full record of your Stata session.  A log is
a file containing what you type and Stata's output.

{pstd}
{cmd:cmdlog} allows you to make a record of what you type during your Stata
session.  A command log contains only what you type, so it is a subset of a
full log.

{pstd}
You can make full logs, command logs, or both simultaneously.
Neither is produced until you tell Stata to start logging.

{pstd}
Command logs are always ASCII text files, making them easy to convert
into do-files.  (In this respect, it would make more sense if the default
extension of a command log file was {cmd:.do} because command logs are
do-files.  The default is {cmd:.txt}, not {cmd:.do}, however, to keep you from
accidentally overwriting your important do-files.)

{pstd}
Full logs are recorded in one of two formats: SMCL (Stata Markup and Control
Language) or text (meaning ASCII).  The default is SMCL, but you can use
{cmd:set logtype} to change that, or you can specify an option to state the
format you wish.  We recommend SMCL because it preserves fonts and colors.
SMCL logs can be converted to ASCII text or to other formats using the
{cmd:translate} command; see {helpb translate}.  You can also use
{cmd:translate} to produce printable versions of SMCL logs.  SMCL logs can be
viewed and printed from the Viewer, as can any file; see {helpb view}.

{pstd}
{cmd:log} or {cmd:cmdlog}, typed without arguments, reports the status of
logging.

{pstd}
{cmd:log using} and {cmd:cmdlog using} open a log file.  {cmd:log close}
and {cmd:cmdlog close} close the file.  Between times, {cmd:log off} and
{cmd:cmdlog off}, and {cmd:log on} and {cmd:cmdlog on} can temporarily
suspend and resume logging.

{pstd}
{cmd:set logtype} specifies the default format in which full logs are to be
recorded.  Initially, full logs are recorded in SMCL format.

{pstd}
{cmd:set linesize} specifies the width of the screen currently being used
(and so really has nothing to do with logging).  Note that not all Stata
commands respect {cmd:linesize}.  Also, note that there is no 
{opt permanently} option allowed with {cmd:set linesize}.


{title:Options for use with both log and cmdlog}

{phang}
{opt append} specifies that results be appended onto the end of an existing
file.  If the file does not already exist, a new file is created.

{phang}
{opt replace} specifies that {it:filename}, if it already exists, be
overwritten.  When you do not specify either {opt replace} or {opt append},
the file is assumed to be new.  If the specified file already exists, an error
message is issued and logging is not started.


{title:Options for use with log}

{phang}
{opt text} and {opt smcl} specify the format in which the log is to be
recorded.  The default is complicated to describe but is what you would
expect:

{pmore}
If you specify the file as {it:filename}{cmd:.smcl}, the default is to write
the log in SMCL format (regardless of the value of {cmd:set logtype}).

{pmore}
If you specify the file as {it:filename}{cmd:.log}, the default is to write
the log in text format (regardless of the value of the {cmd:set logtype}).

{pmore}
If you type {it:filename} without an extension and specify neither the
{opt smcl} option nor the {opt text} option, the default is to write the file
according to the value of {cmd:set logtype}.  If you have not
{cmd:set logtype}, then the default is SMCL.  In addition, the {it:filename}
you specified will be fixed to read {it:filename}{cmd:.smcl} if a SMCL log is
being created or {it:filename}{cmd:.log} if a text log is being created.

{pmore}
If you specify either of the options {cmd:text} or {cmd:smcl}, then
what you specify determines how the log is written.  If {it:filename} was
specified without an extension, the appropriate extension is added for you.


{title:Option for use with set logtype}

{phang}
{opt permanently} specifies that, in addition to making the change right now,
the {cmd:logtype} setting be remembered and become the default setting 
when you invoke Stata.


{title:Examples}

{phang}{cmd:. log using mylog}

{phang}{cmd:. log close}

{phang}{cmd:. log using mylog, append}

{phang}{cmd:. log close}

{phang}{cmd:. log using "filename containing spaces"}


{title:Also see}

{psee}
Manual:  {bf:[R] log}

{psee}
Online:  {helpb translate};{break}
{helpb more}, {helpb query}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -