2.3.81. LOG

Records user input and places it in a specified file.

Syntax

LOG [/A] [{OFF | ON="filename"}]

where:

/A

Specifies that new records are to be added to any that already exist in the specified file.

OFF

Closes the log file and stops collecting information. This is the default.

ON

Starts writing information to the log file.

filename

Specifies the name of the log file. Quotation marks are optional, but see Rules for specifying filenames in the LOG command for details on how to specify filenames that include a path.

Description

This command records user input and places it in a specified file. Commands that are issued but not successfully completed are written to the log file as comments along with the associated error codes. All successful commands are written to the log file, so the file can be used as an INCLUDE file.

Note

If you want to use the log file as an INCLUDE file, first remove the log command that appears at the start of the file.

If the specified file exists and you do not specify the /A parameter, the existing contents of the file are overwritten and lost.

Using LOG with no parameters shows the current log file, if any. User input is recorded in the log file until the LOG OFF command is issued.

The LOG command runs asynchronously unless in a macro.

Rules for specifying filenames in the LOG command

Follow these rules when specifying a filename:

  • If the filename consists of only alphanumeric characters, slashes, or a period, but the filename does not start with a slash, then you do not have to use quotation marks. For example, includes/file.

  • Filenames with a leading slash must be in double quotation marks, for example "/file".

  • Filenames containing a backslash must be in single quotation marks. For example '\file' or 'c:\myfiles\file'.

    Alternatively, you can escape each backslash and use double quotation marks. For example, "c:\\myfiles\\file".

  • You can use environment variables to specify paths to a file. For example, if PATHROOT=C:\MYFILES and PATHTEST=TEST1:

    '$PATHROOT\$PATHTEST\test1.c'
    

    You can include:

    • the filename as part of the second environment variable, and then specify '$PATHROOT\$PATHTEST'.

    • the path separator in the environment variable, and then specify '$PATHROOT$PATHTEST'.

Example

The following examples show how to use LOG:

LOG ON='c:\temp\log.txt'

Start logging output to the file c:\temp\log.txt, overwriting any existing file of that name.

LOG /A ON="log"

Start logging output to the file log.log in the current directory of the debugger, appending the new log text to the file if it already exists.

LOG OFF

Stop logging output.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111