Subversion Repositories Sigmater

Rev

Blame | Last modification | View Log | Download | RSS feed

<?php


/* apro il file di log */
function open_log($path_log){
  //echo "Il valore del path del file di log vale ".$path_log; 
  $fp_log=fopen($path_log,"w+");
  if(!$fp_log){
      echo "Errore apertura del file di log";
      return false;
  }
  write_log($fp_log,"****************************************************************");
  return $fp_log;
}

/* scrivo sul file di log */
function write_log($fp_log,$msg){

   $date = date("Ymd-H:i:s");
   $msg =$date." ".$msg."\n";
   fwrite($fp_log,$msg);
   
}

// chiudo il file di log
function close_log($fp_log)
{
  write_log($fp_log,"****************************************************************");
  fclose($fp_log);
}
?>