Crunz\Logger\LoggerFactory::makeOne PHP Method

makeOne() public static method

Create an instance of the Logger class
public static makeOne ( array $streams = [] ) : Logger
$streams array
return Logger\Logger
    public static function makeOne(array $streams = [])
    {
        $logger = new Logger(new MonologLogger('crunz'));
        // Adding stream for normal output
        foreach ($streams as $stream => $file) {
            if (!$file) {
                continue;
            }
            $logger->addStream($file, $stream, false);
        }
        return $logger;
    }

Usage Example

Example #1
0
 /**
  * Instantiate the event runner
  *
  */
 public function __construct()
 {
     $this->configurable();
     // Create an insance of the Logger
     $this->logger = LoggerFactory::makeOne(['info' => $this->config('output_log_file'), 'error' => $this->config('errors_log_file')]);
     // Initializing the invoker
     $this->invoker = new Invoker();
     // Initializing the invoker
     $this->mailer = new Mailer();
 }
All Usage Examples Of Crunz\Logger\LoggerFactory::makeOne
LoggerFactory