GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
ThreadedLoggerAttachment Class Reference

Public Member Functions

 call ($level, $message)
 
 addAttachment (\ThreadedLoggerAttachment $attachment)
 
 removeAttachment (\ThreadedLoggerAttachment $attachment)
 
 removeAttachments ()
 
 getAttachments ()
 
- Public Member Functions inherited from Threaded
 chunk ($size, bool $preserve=false)
 
 count ()
 
 isRunning ()
 
 isTerminated ()
 
 merge ($from, $overwrite=true)
 
 notify ()
 
 notifyOne ()
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 pop ()
 
 run ()
 
 shift ()
 
 synchronized (\Closure $function, $args=null)
 
 wait ($timeout)
 
 getRefCount ()
 
 addRef ()
 
 delRef ()
 
 isGarbage ()
 
- Public Member Functions inherited from LoggerAttachment
 log ($level, $message)
 

Protected Attributes

 $attachment = null
 

Additional Inherited Members

- Static Public Member Functions inherited from Threaded
static extend ($obj)
 

Member Function Documentation

◆ addAttachment()

addAttachment ( \ThreadedLoggerAttachment  $attachment)
Parameters
ThreadedLoggerAttachment$attachment
37  {
38  if($this->attachment instanceof \ThreadedLoggerAttachment){
39  $this->attachment->addAttachment($attachment);
40  }else{
41  $this->attachment = $attachment;
42  }
43  }

◆ call()

call (   $level,
  $message 
)
final
Parameters
mixed$level
string$message
27  {
28  $this->log($level, $message);
29  if($this->attachment instanceof \ThreadedLoggerAttachment){
30  $this->attachment->call($level, $message);
31  }
32  }

◆ getAttachments()

getAttachments ( )
Returns
[]
69  {
70  $attachments = [];
71  if($this->attachment instanceof \ThreadedLoggerAttachment){
72  $attachments[] = $this->attachment;
73  $attachments += $this->attachment->getAttachments();
74  }
75 
76  return $attachments;
77  }

◆ removeAttachment()

removeAttachment ( \ThreadedLoggerAttachment  $attachment)
Parameters
ThreadedLoggerAttachment$attachment
48  {
49  if($this->attachment instanceof \ThreadedLoggerAttachment){
50  if($this->attachment === $attachment){
51  $this->attachment = null;
52  foreach($attachment->getAttachments() as $attachment){
53  $this->addAttachment($attachment);
54  }
55  }
56  }
57  }

◆ removeAttachments()

removeAttachments ( )
59  {
60  if($this->attachment instanceof \ThreadedLoggerAttachment){
61  $this->attachment->removeAttachments();
62  $this->attachment = null;
63  }
64  }

Field Documentation

◆ $attachment

$attachment = null
protected

The documentation for this class was generated from the following file: