<?php
define('idDiGIR_Log','$Id: DiGIR_Log.php,v 1.2 2003/05/06 20:33:19 vieglais Exp $');
if (defined('idDIGIR_VERSION_REQUEST'))
    return;

class DiGIRLogStruct
{
    var $data;
    var $level;

    function DiGIRLogStruct($method,$level=PEAR_LOG_INFO)
    {
        $this->level = $level;
        $this->data = array();
        $this->data['method'] = $method;
        $this->data['status'] = false;
    }
    
    function writeLog($logger)
    {
        $logger->log("data=".str_replace("\n"," ",serialize($this->data)),$this->level);
    }
    
    function setparam($key,$val)
    {
        $this->data[$key] = $val;
    }
}

class DiGIRLog_metadata extends DiGIRLogStruct
{
    function DiGIRLog_metadata()
    {
        DiGIRLogStruct::DiGIRLogStruct("metadata");
        $this->data['status'] = true;
    }
}

class DiGIRLog_search extends DiGIRLogStruct
{
    function DiGIRLog_search($resource,$strfilter,$startrec,$maxrecs,$returnedrecs,$recstr)
    {
        DiGIRLogStruct::DiGIRLogStruct("search");
        $this->data['resource'] = $resource;
        $this->data['filter'] = $strfilter;
        $this->data['startrec'] = $startrec;
        $this->data['maxrecs'] = $maxrecs;
        $this->data['returnedrecs'] = $returnedrecs;
        if (isURL($recstr))
            $this->data['recstr'] = $recstr;
        else
            $this->data['recstr'] = "custom";
    }
}

class DiGIRLog_inventory extends DiGIRLogStruct
{
    function DiGIRLog_inventory($resource,$strfilter,$startrec,$maxrecs,$returnedrecs,$column)
    {
        DiGIRLogStruct::DiGIRLogStruct("inventory");
        $this->data['resource'] = $resource;
        $this->data['filter'] = $strfilter;
        $this->data['startrec'] = $startrec;
        $this->data['maxrecs'] = $maxrecs;
        $this->data['returnedrecs'] = $returnedrecs;
        $this->data['column'] = $column;
    }
}


?>
