PreviousNext
Help > API Functions > Trace (debug purpose) and utility > i5_start_testfile
i5_start_testfile

 

 Activates I5 Easycom trace file.

 

  

bool i5_start_testfile (string trace , int level [, bool TimeStamp [, resource connection])

 

 

Parameters

 

trace

Trace file name to be created (library/file.member)

level

File detail level, 1 to 4

timestamp

Display each operation time and date

connection

Connection ID(optional)

 

Return

True if OK, false if failed.

 

I5_ERR_DESC_WRONG_DATAOP

41

Wrong operation on a data field of a description

I5_ERR_PARSEXML

42

Internal error; please contact Aura Equipements.

error number 42

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x

and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

 

 

Details

This function is for analysis and debug purpose.

It activates a trace file on IBM i.

If the file does not exist it is created, otherwise it is cleared.

Level defines file detail. Level 1 displays only mains functions (low level), level 4 is more detailed.

Time and date in the trace file give precise time of each operation (TRUE or FALSE).

This function is only valuable in a testing or developing context, it reduces heavily machine speed while creating a file which can be very large.

 

Example

 

 

$res = i5_connect("MY_AS", "USER", "PASSWORD");

if (!is_bool($res))

{

                      $ret = i5_start_testfile("EASYCOM/TRACE", 4);}

                      if (!$ret)

                      {

                                        print_r("i5_start_testfile error : ".i5_errormsg().'<br/>');

                      }

                      else

                      {

                                        echo 'Trace activated<br/>';

                      }

              }