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