[_Debug] v.[01.026] rev.[2011-06-06T15:03:00]

  

NAME

  _Debug -- Setting up debug environment for batch scripts 
  

SYNOPSIS

  _Debug 
  

DESCRIPTION

  This function sets up two environment variables 
  _Debug_ and _verbose_ as add ons to ECHO 
  _LOG_ and _TRACE_ prints to log and trace file 
 
  _Verbose_ is simply a replacement for ECHO which can be switch off (Silent mode) 
  _Verbose_ prints to STDOUT. 
  Use this feature instead of ECHO for printing standard info to user. 
 
  _Debug_ is a replacement for ECHO to print debug information to STDERR.  
  By default this is switch off (Redirect to NUL) 
 
  _LOG_ is for general statements 
  _TRACE_ is only for debuging 
 

FLAGS

  SET DEBUG=x 
  0 No debugging (default) 
  1 Debugging active 
  2 Debugging active and ECHO on 
 
  Environment variable _DEBUG_ will either print to NUL 
  OR if active print to STDERR 
 
  SET VERBOSE=x 
  0 Silent 
  1 Normal verbose (Default) 
 
  Environment variable _VERBOSE_ will either print to NUL 
  OR if active print to STDERR 
 

EXAMPLE

  ECHO Default: Verbose on, Debug off 
  CALL _debug.cmd 
  1>&2 ECHO verbosing on 
  1>NUL 2>&1 ECHO Debugging off 
   
  ECHO Alternative: Verbose off, Debug on 
  SET DEBUG=1 
  SET VERBOSE=0 
  CALL _debug.cmd 
  1>&2 ECHO verbosing off 
  1>NUL 2>&1 ECHO Debugging on 
   
  ECHO Debug mode: Verbose on, Debug on level 2 
  SET DEBUG=2 
  SET VERBOSE=1 
  CALL _debug.cmd 
  1>&2 ECHO verbosing on 
  1>NUL 2>&1 ECHO Debugging on (with Echo) 
  

SOURCE

  x:\Scripts.ClicktyClick\Scripts\What.cmd 
  

(C)2011 Erik Bachmann, ClicketyClick.dk (E_Bachmann@ClicketyClick.dk)

HISTORY

VersionRevisionDescription
v.xx.xxx r.YYYY-MM-DDThh:mm:ss Init Description
v.01.000 r.2009-04-17T11:01:00 Initial
v.01.020 r.2009-10-11T20:21:00 New header/EBP
v.01.020 r.2010-10-20T17:00:00 Level 3: ECHO + pause
v.01.021 r.2010-10-20T17:15:00 Addding $Source/EBP
v.01.023 r.2010-12-02T16:43:00 Addding _LOG_ and _Trace_/EBP
v.01.024 r.2011-01-27T14:00:00 Default $LogFile and $TraceFile/EBP
v.01.026 r.2011-06-06T15:03:00 Stub to errorhandler/EBP

_Debug.cmd