Re: Pipe Input/Output

new topic     » goto parent     » topic index » view thread      » older message » newer message

logMsg is not necessary. It is defined as follows

global integer  f_debug = 1    -- debug file 
global integer  debugLevel = 0   -- 0=no debug, 1=debug file only, 2=debug_file and screen output 
 
------------------------------------------------------------------------------ 
 
public function dateStamp(sequence msg) 
-- prefixes the message by date and time for logging 
  sequence cur_date 
 
  cur_date = date() 
  return sprintf("%d-%02d-%02d %02d:%02d:%02d -> %s\n", { 
                             (cur_date[1] + 1900), cur_date[2], cur_date[3], 
                              cur_date[4], cur_date[5], cur_date[6], msg 
                            }) 
end function 
 
------------------------------------------------------------------------------ 
 
public procedure logMsg(sequence msg) 
-- records logs 
  if debugLevel>0 then 
    puts(f_debug, dateStamp(msg)) 
    flush(f_debug) 
  end if 
  if debugLevel>1 then 
    puts(1, dateStamp(msg)) 
  end if 
end procedure 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu