Navigation:  Using Visual Build Professional > Dialogs > Application Options >

Logging Options Tab

Previous pageReturn to chapter overviewNext page

These options from the application options dialog configure global log settings for builds:

 

Enable file logging: When checked, all build output is also written to the specified log file.  Use the Browse button to choose a file, View to view the current log file in the configured viewer, and Delete to delete the log file if it exists.

 

Notes:

Logging can be disabled for individual steps via the 'Do not log action output' step property.
It is recommended that any active scanning anti-virus software be disabled on the build box, as this can interfere with Visual Build writing to its log file (and also slows down builds).

 

Format: Determines the format that will be used to generate the log file.  The available options are Text and XML.  Text log files are similar to the output displayed in the Output pane (including a timestamp for each step). 

 

XML log files are written in a hierarchical XML format, with elements for each build and step.  The log file is appended to as steps are built, so until the build completes, the closing step, build, and log tags (elements) will not yet exist.  The Transform XML Log action can be used to add the closing tags (making the log a valid XML document that can be sent within a build) and also convert XML logs into HTML documents.  The Logging.bld sample demonstrates several techniques that are useful when using the XML log format (including deleting an XML log file before a build and disabling/enabling file logging during a build via code in script events).  For easier browsing of the file in Internet Explorer, XML log filenames can be given a .XML extension.

 

Note: To make the build log accessible to other users, simply map an IIS or web server virtual directory to the path containing the log files, and the log files can be accessed via any web browser.

 

Log Filename: The name of the log file to write build output to if file logging is enabled (this value is available in the system macro LOGFILE if logging is enabled).  This is a global setting that affects all builds, unless the LOGFILE macro is overridden by a project.  Project-specific log files can also be used for every project automatically by entering %PROJDIR%\%PROJROOT%.<ext> in this field.  These system macros will be expanded when a project is built and the path and root name of the project file will be used for the log file.

 

The log filename can also be overridden for a given project in the Project Properties dialog or by passing in a temporary LOGFILE on the command-line.  This can be useful for creating project-specific log files or to dynamically modify the target filename (for instance, to temporarily disable file logging).  See the Logging.bld sample for more details.

 

Note: If the log file cannot be written to, the error information will be written to the Windows Event Viewer Application tab (available in Administrative Tools).

 

View: Opens the log file in the viewer configured in the user options.

 

Launch: Opens the log file in the associated application (for instance, Internet Explorer for XML files).

 

Delete: Deletes the log file if it exists.

 

Delete log file at the start of each build: If checked, the log file will be deleted at the beginning of each build.  Otherwise, the log file is appended to with each build.  When using XML logging and master/child projects that use the same log file, this option should not be checked, because it would cause the log file to be deleted at the beginning of the master and each child project.  Instead, the first step from the Logging.bld sample should be added to the start of the master project.

 

Log default property of each step: If checked, each step's default property will be logged when it is built.  This can be useful for debugging purposes.

 

Log build rule when a step is skipped or repeated: If checked, when a step's repeating build rule is processed or when a step with a build rule is skipped, the details of the build rule will be logged.

 

Strip carriage return/linefeed characters within log messages: If checked, new line characters are removed within each log message so that each message stays on the same line in the file.  If unchecked, the output contents are written to the log without changes.

 

Convert double quote characters to single quotes in step output macros: Whether to convert double quotes in the LASTSTEP_OUTPUT and FAILSTEP_OUTPUT system macros to single quotes.  Checking this option this can be useful if the macro will be referenced in script expressions, but it can cause problems for quoted values in XML output containing single quotes.

 

Escape special VBP characters in step output macros: Whether to escape characters in the LASTSTEP_OUTPUT and FAILSTEP_OUTPUT system macros.  Bracket characters [ and ] normally denote a script expression to be inserted into a field, and the percent sign character % is normally used around a macro name for its value to be expanded within the field.  If this option is checked, these special characters in step output will be doubled [[ ]] %%

 

Note: This option should be checked if the output macros will be referenced in step fields (i.e., %LASTSTEP_OUTPUT%) so that any special characters will be treated as literal characters by VBP.

 

Echo output from console programs called from Console app: Determines whether to echo the output of console programs called from a build using the Console application.  If checked, the output of any console programs called by a Run Program or VisBuildPro Project step or any action that calls the Builder object's RunProgram or RunProgramEx methods will be echoed to the console that VisBuildCmd is running in.  If unchecked, any output of such chained programs will not be echoed.