XBSLOG
[ class tree: XBSLOG ] [ index: XBSLOG ] [ all elements ]

Class: Xbs_logLoggerHandler

Source Location: /class/Logger.php

Class Overview

XoopsObjectHandler
   |
   --Xbs_logLoggerHandler

Writes and reads log entries for any application


Author(s):

  • Ashley Kitson http://xoobs.net

Copyright:

  • (c) 2006 Ashley Kitson, Great Britain

Methods



Class Details

[line 63]
Writes and reads log entries for any application

To use this class do the following:

include_once(XOOPS_ROOT_PATH."/modules/xbs_log/include/defines.php");
$myLogger =& xoops_getmodulehandler('Logger',XBSLOG_DIR);
$myLogger->setLogName("<name of logger>"); //NB limited to 10 characters
$stage = "start"; //NB stage tag limited to 10 characters
$processMsg = "Some message" //NB message limited to 255 characters
$myLogger->log($stage,$processMsg);




Tags:

copyright:  (c) 2006 Ashley Kitson, Great Britain
author:  Ashley Kitson http://xoobs.net


[ Top ]


Class Methods


constructor Xbs_logLoggerHandler [line 82]

Xbs_logLoggerHandler Xbs_logLoggerHandler( @XoopsDb &$db)

Constructor



Tags:

return:  object


Parameters:

@XoopsDb   $db  

[ Top ]

method floatMtimeToDate [line 118]

string floatMtimeToDate( double $mTime)

convert a double (float) microtime to date-time-microtime string



Tags:

return:  date format string suffixed with .microseconds


Parameters:

double   $mTime   float in standard microtime(true) format

[ Top ]

method getFname [line 146]

string getFname( )

return the full log file path and name



Tags:

return:  log file path and name


[ Top ]

method getLogEntries [line 203]

array getLogEntries( int $start, int $limit)

get an array of log entries



Tags:

return:  an array of row arrays


Parameters:

int   $start   start record number
int   $limit   number of rows to return

[ Top ]

method getRowsNum [line 226]

int getRowsNum( )

Get the number of log entries



[ Top ]

method log [line 156]

void log( string $stage, string $processMsg)

Write an entry to the disk log



Parameters:

string   $stage   arbitrary string that denotes stage of process but typically 'start', 'end' etc
string   $processMsg   arbitrary message to put in log

[ Top ]

method mtimeToDate [line 105]

string mtimeToDate( string $mTimeStr)

convert microtime string to formatted date-time-microtime



Tags:

return:  date format string suffixed with .microseconds


Parameters:

string   $mTimeStr   microtime string "msec sec"

[ Top ]

method mtimeToFloat [line 133]

real mtimeToFloat( string $mTimeStr)

convert microtime string value to real

This is only required because php4 does not support microtime(true) which isn't available until php5




Tags:

return:  (double) microtime as float (ie as per microtime(true))


Parameters:

string   $mTimeStr   microtime string in 'msec sec' format

[ Top ]

method readLogToDB [line 172]

void readLogToDB( )

Reads disk log into database table and clears disk log



[ Top ]

method setLogName [line 95]

void setLogName( [string $logName = 'XBS'])

Set the logger name



Parameters:

string   $logName   arbitrary name for this logger

[ Top ]


Documentation generated on Wed, 29 Mar 2006 14:01:54 +0100 by phpDocumentor 1.3.0RC3