Log the message if the logger is configured to log from this producer
@param $producer the source of logging ( one of the SPLog::PRODUCER_* values )
@param $msg the actual message
@param bool $object
171433
public function log($producer, $msg, $object = false) {
        if(!($this->acceptedProducers & $producer)) { return; }

        $msgFmt = self::format($msg, $this->processId, $this->time, $this->flags);
        if($object) {
            $msgFmt .= " " . json_encode($object);
        }
        $this->logRaw($msgFmt);
    }
761824
public function debug($msg, $data = NULL) {
        if (!$this->isAllowToLog(static::LOG_LEVEL_DEBUG)) {
            return;
        }

        $this->log('debug', $msg, $data);
    }
1286111
public function log($msg, $runlevel = self::LEVEL_INFO) {
		$time = time();
		#$this->data[] = array($this->runlevel, $msg, $time);
		if($this->printout and $runlevel <= $this->runlevel) {
			$this->writeLine($msg, $runlevel, $time);
		}
	}
1315668
protected function broadcast(string $msg, bool $global = true): Generator
    {
        Logger::log('worker', $this->pid, 'send to all: ', $msg);

        foreach ($this->clients as $client) {
            yield Dispatcher::async($this->write($client, $msg));
        }

        if ($global) {
            yield Dispatcher::async($this->write($this->master, $msg));
        }
    }
920674
public function debug($msg = true, $file = null, $line = null)
    {
        if (is_bool($msg)) {
            $this->debug = $msg;

            return $this;
        }

        if (is_object($msg)) {
            throw $this->exception('Do not debug objects');
        }

        // The rest of this method is obsolete
        if ((isset($this->debug) && $this->debug)
            || (isset($this->app->debug) && $this->app->debug)
        ) {
            $this->app->outputDebug($this, $msg, $file/*, $line*/);
        }
    }
195551
public function writeLog(string $file, $msg, bool $raw = false): void
    {
        //是否允许记录开发人员日志
        configDefault(false, 'log', 'writeLog') ? $this->log($file, $msg, $raw) : null;
    }
206272
public static function log($msg)
    {
        $msg = $msg . "\n";
        if (!self::$daemonize) {
            self::safeEcho($msg);
        }
        file_put_contents((string)self::$logFile, date('Y-m-d H:i:s') . ' ' . 'pid:' . getmypid() . ' ' . $msg, FILE_APPEND | LOCK_EX);
    }
1031145
private static function _logToFile($msg)
    {
        if (is_null(self::$_file) || (is_string(self::$_file) && !self::_openLogFile())) {
            return false;
        }
        return fwrite(self::$_file, "$msg\n");
    }
1226485
protected function tryLog($msg, $tries = 0)
    {
        if ((bool)@fwrite($this->stream, $msg))
            return;

        if (0 < $tries)
        {
            trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
            return;
        }

        $this->attemptStreamRecovery();

        $this->tryLog($msg, ++$tries);
    }
1130542
public static function log(string $msg, array $data = [], int $level = self::VERB_DEBUG, array $opts = []): void
    {
        $levelName  = self::LEVEL_NAMES[$level] ?? 'INFO';
        $colorName  = self::LEVEL2TAG[$level] ?? 'info';
        $taggedName = ColorTag::add($levelName, $colorName);

        $userOpts = [];
        foreach ($opts as $n => $v) {
            if (\is_numeric($n) || \strpos($n, '_') === 0) {
                $userOpts[] = "[$v]";
            } else {
                $userOpts[] = "[$n:$v]";
            }
        }

        $optString = $userOpts ? ' ' . \implode(' ', $userOpts) : '';

        self::write(\sprintf(
            '%s [%s]%s %s %s',
            \date('Y/m/d H:i:s'),
            $taggedName,
            $optString,
            \trim($msg),
            $data ? \PHP_EOL . \json_encode($data, \JSON_UNESCAPED_SLASHES | \JSON_PRETTY_PRINT) : ''
        ));
    }
1298840
public function onServiceMessage(MessageInterface $msg)
    {
        $this->serviceStreamReady = true;

        $this->getLogger()->debug('Received Service Message of Type: '.get_class($msg));

        if ($msg instanceof ActionListResponse) {
            $actions = $msg->getActions();
            $this->getLogger()->debug('The action list is: '.implode(', ', $actions).'.');
            $this->worker->setActions($actions);

            $reply = new Register();
            $reply->setActions($actions);
            $this->sendToWorkerHandler($reply);
            unset($reply);

            return;
        }

        if ($msg instanceof ExecuteJobResponse) {
            $requestId = $msg->getRequestId();
            $result    = $msg->getResult();
            $this->getLogger()->debug('Result for: '.$requestId.': '.$result);
            $this->worker->setResult($requestId, $result);

            return;
        }

        $this->getLogger()->error('Unknown service response: '.get_class($msg).'.');
    }
923944
public function write($object, $level)
    {
        //Determine label
        $label = 'DEBUG';
        switch ($level) {
            case \Yee\Log::FATAL:
                $label = 'FATAL';
                break;
            case \Yee\Log::ERROR:
                $label = 'ERROR';
                break;
            case \Yee\Log::WARN:
                $label = 'WARN';
                break;
            case \Yee\Log::INFO:
                $label = 'INFO';
                break;
        }

        //Get formatted log message
        $message = str_replace(array(
            '%label%',
            '%date%',
            '%message%'
        ), array(
            $label,
            date('Y-m-d H:i:s'),
            (string)$object
        ), $this->settings['message_format']);

        //Open resource handle to log file
        if (!$this->resource) {
            $filename = date($this->settings['name_format']);
            if (! empty($this->settings['extension'])) {
                $filename .= '.' . $this->settings['extension'];
            }
            $this->resource = fopen($this->settings['path'] . DIRECTORY_SEPARATOR . $filename, 'a');
        }

       
        
        //Output to resource
        fwrite($this->resource, $message . PHP_EOL);
    }
76333
public static function log($msg)
    {
        $msg = $msg . "\n";
        if (!static::$daemonize) {
            static::safeEcho($msg);
        }
        file_put_contents((string)static::$logFile, date('Y-m-d H:i:s') . ' ' . 'pid:'
            . (static::$_OS === OS_TYPE_LINUX ? posix_getpid() : 1) . ' ' . $msg, FILE_APPEND | LOCK_EX);
    }
443879
public function log($level, $message, array $context = []) {
		if (!Logger::check($level)) {
			return;
		}
		if (count($context) > 0) {
			foreach ($context as $k => $v) {
				$message = str_replace('{' . $k . '}', $v, $message);
			}
		}
		syslog($this->getLevel($level), $message);
	}
547356
public function log($level, $object, $context = array())
    {
        if (!isset(self::$levels[$level])) {
            throw new \InvalidArgumentException('Invalid log level supplied to function');
        } else if ($this->enabled && $this->writer && $level <= $this->level) {
            $message = (string)$object;
            if (count($context) > 0) {
                if (isset($context['exception']) && $context['exception'] instanceof \Exception) {
                    $message .= ' - ' . $context['exception'];
                    unset($context['exception']);
                }
                $message = $this->interpolate($message, $context);
            }
            return $this->writer->write($message, $level);
        } else {
            return false;
        }
    }
1258961
public function logWarning($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_WARNING, $message, $object);
    }
158151
public function log($msg, array $data = [], $level = Logger::INFO): void
    {
        $this->mgr->log($msg, $data, $level);
    }