xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET ERRORLOG

Defines the default error log file.

Syntax

SET ERRORLOG TO <cLogFile> [ADDITIVE]

Arguments

<cLogFile>
This is the name of the file that stores information about runtime errors. The default file is named "Error.log"
ADDITIVE
If this option is specified, new error information is appended to the log file. Otherwise, <cLogFile> is overwritten when a new error occurs.

Description

The SET ERRORLOG command is used in customized error handling routines where error information about runtime errors is written to a user-defined file. By default, runtime error information is stored in the Error.log file.

Note:  xHarbour's default error handling routine is programmed in the file ERRORSYS.PRG.

Info

See also:BEGIN SEQUENCE, Error(), ErrorBlock(), Set(), SET ERRORLOOP, TRY...CATCH
Category: Environment commands , SET commands , xHarbour extensions
Source:rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates how a particular type of errors can be logged
// in a separate file. The file receives information about file open errors.

   PROCEDURE Main

      ? OpenDatabases()

   RETURN

   FUNCTION OpenDatabases()
      LOCAL aErrLog := Set( _SET_ERRORLOG )
      LOCAL oError
      LOCAL lSuccess := .T.

      SET ERRORLOG TO DbOpenError.log ADDITIVE

      USE Customer
      SET INDEX TO Cust01, Cust02

      SET ERRORLOG TO ( aErrLog[1] )
   RETURN lSuccess

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe