This commit is contained in:
Shoghi Cervantes 2015-02-15 19:01:25 +01:00
parent 21e0739845
commit 5f4f996efe
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -194,9 +194,6 @@ class MainLogger extends \AttachableThreadedLogger{
}
$this->logStream .= date("Y-m-d", $now) . " " . $cleanMessage;
$this->synchronized(function(){
$this->notify();
});
}
public function run(){
@ -207,18 +204,14 @@ class MainLogger extends \AttachableThreadedLogger{
}
while($this->shutdown === false){
if($this->logStream !== ""){
$this->synchronized(function(){
$this->lock();
$chunk = $this->logStream;
$this->logStream = "";
$this->unlock();
fwrite($this->logResource, $chunk);
});
if(strlen($this->logStream) > 0){
$this->lock();
$chunk = $this->logStream;
$this->logStream = "";
$this->unlock();
fwrite($this->logResource, $chunk);
}else{
$this->synchronized(function(){
$this->wait(250000);
});
usleep(250000);
}
}