Updated subclassing of Client/Worker LogEntry classes
This commit is contained in:
@@ -2,37 +2,22 @@
|
|||||||
|
|
||||||
class RippingCluster_ClientLogEntry extends RippingCluster_LogEntry {
|
class RippingCluster_ClientLogEntry extends RippingCluster_LogEntry {
|
||||||
|
|
||||||
protected $jobId;
|
public static function debug($logger, $job_id, $message) {
|
||||||
|
static::log($logger, SihnonFramework_Log::LEVEL_DEBUG, $job_id, $message, 'client');
|
||||||
protected function __construct($id, $level, $ctime, $pid, $hostname, $progname, $line, $message, $jobId) {
|
|
||||||
parent::__construct($id, $level, $ctime, $pid, $hostname, $progname, $line, $message);
|
|
||||||
|
|
||||||
$this->jobId = $jobId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fromDatabaseRow($row) {
|
public static function info($logger, $job_id, $message) {
|
||||||
return new self(
|
static::log($logger, SihnonFramework_Log::LEVEL_INFO, $job_id, $message, 'client');
|
||||||
$row['id'],
|
|
||||||
$row['level'],
|
|
||||||
$row['ctime'],
|
|
||||||
$row['pid'],
|
|
||||||
$row['hostname'],
|
|
||||||
$row['progname'],
|
|
||||||
$row['line'],
|
|
||||||
$row['message'],
|
|
||||||
$row['job_id']
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function initialise() {
|
public static function warning($logger, $job_id, $message) {
|
||||||
parent::$table_name = 'client_log';
|
static::log($logger, SihnonFramework_Log::LEVEL_WARNING, $job_id, $message, 'client');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jobId() {
|
public static function error($logger, $job_id, $message) {
|
||||||
return $this->jobId;
|
static::log($logger, SihnonFramework_Log::LEVEL_ERROR, $job_id, $message, 'client');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RippingCluster_ClientLogEntry::initialise();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -2,38 +2,22 @@
|
|||||||
|
|
||||||
class RippingCluster_WorkerLogEntry extends RippingCluster_LogEntry {
|
class RippingCluster_WorkerLogEntry extends RippingCluster_LogEntry {
|
||||||
|
|
||||||
protected $jobId;
|
public static function debug($logger, $job_id, $message) {
|
||||||
|
static::log($logger, SihnonFramework_Log::LEVEL_DEBUG, $job_id, $message, 'worker');
|
||||||
protected function __construct($id, $level, $ctime, $pid, $hostname, $progname, $line, $message, $jobId) {
|
|
||||||
parent::__construct($id, $level, $ctime, $pid, $hostname, $progname, $line, $message);
|
|
||||||
|
|
||||||
$this->jobId = $jobId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fromDatabaseRow($row) {
|
public static function info($logger, $job_id, $message) {
|
||||||
return new self(
|
static::log($logger, SihnonFramework_Log::LEVEL_INFO, $job_id, $message, 'worker');
|
||||||
$row['id'],
|
|
||||||
$row['level'],
|
|
||||||
$row['ctime'],
|
|
||||||
$row['pid'],
|
|
||||||
$row['hostname'],
|
|
||||||
$row['progname'],
|
|
||||||
$row['line'],
|
|
||||||
$row['message'],
|
|
||||||
$row['job_id']
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function initialise() {
|
public static function warning($logger, $job_id, $message) {
|
||||||
parent::$table_name = 'worker_log';
|
static::log($logger, SihnonFramework_Log::LEVEL_WARNING, $job_id, $message, 'worker');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jobId() {
|
public static function error($logger, $job_id, $message) {
|
||||||
return $this->jobId;
|
static::log($logger, SihnonFramework_Log::LEVEL_ERROR, $job_id, $message, 'worker');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RippingCluster_WorkerLogEntry::initialise();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user