golden hour
/home/doctorbruno/.trash/google-site-kit/third-party/monolog/monolog/src/Monolog/Handler
⬆️ Go Up
Upload
File/Folder
Size
Actions
AbstractHandler.php
2.89 KB
Del
OK
AbstractProcessingHandler.php
2.03 KB
Del
OK
AbstractSyslogHandler.php
3.95 KB
Del
OK
AmqpHandler.php
5.24 KB
Del
OK
BrowserConsoleHandler.php
9.77 KB
Del
OK
BufferHandler.php
5.13 KB
Del
OK
ChromePHPHandler.php
5.56 KB
Del
OK
CouchDBHandler.php
2.19 KB
Del
OK
CubeHandler.php
5.6 KB
Del
OK
Curl
-
Del
OK
DeduplicationHandler.php
6.23 KB
Del
OK
DoctrineCouchDBHandler.php
1.47 KB
Del
OK
DynamoDbHandler.php
2.88 KB
Del
OK
ElasticaHandler.php
3.75 KB
Del
OK
ElasticsearchHandler.php
7.17 KB
Del
OK
ErrorLogHandler.php
2.85 KB
Del
OK
FallbackGroupHandler.php
1.79 KB
Del
OK
FilterHandler.php
7.68 KB
Del
OK
FingersCrossed
-
Del
OK
FingersCrossedHandler.php
9.3 KB
Del
OK
FirePHPHandler.php
5.32 KB
Del
OK
FleepHookHandler.php
3.65 KB
Del
OK
FlowdockHandler.php
3.86 KB
Del
OK
FormattableHandlerInterface.php
1.02 KB
Del
OK
FormattableHandlerTrait.php
1.57 KB
Del
OK
GelfHandler.php
1.72 KB
Del
OK
GroupHandler.php
3.58 KB
Del
OK
Handler.php
1.29 KB
Del
OK
HandlerInterface.php
2.99 KB
Del
OK
HandlerWrapper.php
4.15 KB
Del
OK
IFTTTHandler.php
2.37 KB
Del
OK
InsightOpsHandler.php
2.03 KB
Del
OK
LogEntriesHandler.php
1.88 KB
Del
OK
LogglyHandler.php
4.38 KB
Del
OK
LogmaticHandler.php
2.79 KB
Del
OK
MailHandler.php
2.51 KB
Del
OK
MandrillHandler.php
2.71 KB
Del
OK
MissingExtensionException.php
502 B
Del
OK
MongoDBHandler.php
2.91 KB
Del
OK
NativeMailerHandler.php
5.07 KB
Del
OK
NewRelicHandler.php
6.42 KB
Del
OK
NoopHandler.php
958 B
Del
OK
NullHandler.php
1.51 KB
Del
OK
OverflowHandler.php
5.11 KB
Del
OK
PHPConsoleHandler.php
11.14 KB
Del
OK
ProcessHandler.php
5.17 KB
Del
OK
ProcessableHandlerInterface.php
1.27 KB
Del
OK
ProcessableHandlerTrait.php
1.86 KB
Del
OK
PsrHandler.php
2.8 KB
Del
OK
PushoverHandler.php
7.92 KB
Del
OK
RedisHandler.php
3.21 KB
Del
OK
RedisPubSubHandler.php
2.09 KB
Del
OK
RollbarHandler.php
3.68 KB
Del
OK
RotatingFileHandler.php
6.46 KB
Del
OK
SamplingHandler.php
4.8 KB
Del
OK
SendGridHandler.php
3.04 KB
Del
OK
Slack
-
Del
OK
SlackHandler.php
7.08 KB
Del
OK
SlackWebhookHandler.php
4.19 KB
Del
OK
SocketHandler.php
12.09 KB
Del
OK
SqsHandler.php
1.97 KB
Del
OK
StreamHandler.php
8.57 KB
Del
OK
SwiftMailerHandler.php
4.14 KB
Del
OK
SymfonyMailerHandler.php
4.04 KB
Del
OK
SyslogHandler.php
2.08 KB
Del
OK
SyslogUdp
-
Del
OK
SyslogUdpHandler.php
4.66 KB
Del
OK
TelegramBotHandler.php
8.25 KB
Del
OK
TestHandler.php
6.8 KB
Del
OK
WebRequestRecognizerTrait.php
554 B
Del
OK
WhatFailureGroupHandler.php
1.98 KB
Del
OK
ZendMonitorHandler.php
3.78 KB
Del
OK
Edit: OverflowHandler.php
<?php declare (strict_types=1); /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Google\Site_Kit_Dependencies\Monolog\Handler; use Google\Site_Kit_Dependencies\Monolog\Logger; use Google\Site_Kit_Dependencies\Monolog\Formatter\FormatterInterface; /** * Handler to only pass log messages when a certain threshold of number of messages is reached. * * This can be useful in cases of processing a batch of data, but you're for example only interested * in case it fails catastrophically instead of a warning for 1 or 2 events. Worse things can happen, right? * * Usage example: * * ``` * $log = new Logger('application'); * $handler = new SomeHandler(...) * * // Pass all warnings to the handler when more than 10 & all error messages when more then 5 * $overflow = new OverflowHandler($handler, [Logger::WARNING => 10, Logger::ERROR => 5]); * * $log->pushHandler($overflow); *``` * * @author Kris Buist <krisbuist@gmail.com> */ class OverflowHandler extends \Google\Site_Kit_Dependencies\Monolog\Handler\AbstractHandler implements \Google\Site_Kit_Dependencies\Monolog\Handler\FormattableHandlerInterface { /** @var HandlerInterface */ private $handler; /** @var int[] */ private $thresholdMap = [\Google\Site_Kit_Dependencies\Monolog\Logger::DEBUG => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::INFO => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::NOTICE => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::WARNING => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::ERROR => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::CRITICAL => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::ALERT => 0, \Google\Site_Kit_Dependencies\Monolog\Logger::EMERGENCY => 0]; /** * Buffer of all messages passed to the handler before the threshold was reached * * @var mixed[][] */ private $buffer = []; /** * @param HandlerInterface $handler * @param int[] $thresholdMap Dictionary of logger level => threshold */ public function __construct(\Google\Site_Kit_Dependencies\Monolog\Handler\HandlerInterface $handler, array $thresholdMap = [], $level = \Google\Site_Kit_Dependencies\Monolog\Logger::DEBUG, bool $bubble = \true) { $this->handler = $handler; foreach ($thresholdMap as $thresholdLevel => $threshold) { $this->thresholdMap[$thresholdLevel] = $threshold; } parent::__construct($level, $bubble); } /** * Handles a record. * * All records may be passed to this method, and the handler should discard * those that it does not want to handle. * * The return value of this function controls the bubbling process of the handler stack. * Unless the bubbling is interrupted (by returning true), the Logger class will keep on * calling further handlers in the stack with a given log record. * * {@inheritDoc} */ public function handle(array $record) : bool { if ($record['level'] < $this->level) { return \false; } $level = $record['level']; if (!isset($this->thresholdMap[$level])) { $this->thresholdMap[$level] = 0; } if ($this->thresholdMap[$level] > 0) { // The overflow threshold is not yet reached, so we're buffering the record and lowering the threshold by 1 $this->thresholdMap[$level]--; $this->buffer[$level][] = $record; return \false === $this->bubble; } if ($this->thresholdMap[$level] == 0) { // This current message is breaking the threshold. Flush the buffer and continue handling the current record foreach ($this->buffer[$level] ?? [] as $buffered) { $this->handler->handle($buffered); } $this->thresholdMap[$level]--; unset($this->buffer[$level]); } $this->handler->handle($record); return \false === $this->bubble; } /** * {@inheritDoc} */ public function setFormatter(\Google\Site_Kit_Dependencies\Monolog\Formatter\FormatterInterface $formatter) : \Google\Site_Kit_Dependencies\Monolog\Handler\HandlerInterface { if ($this->handler instanceof \Google\Site_Kit_Dependencies\Monolog\Handler\FormattableHandlerInterface) { $this->handler->setFormatter($formatter); return $this; } throw new \UnexpectedValueException('The nested handler of type ' . \get_class($this->handler) . ' does not support formatters.'); } /** * {@inheritDoc} */ public function getFormatter() : \Google\Site_Kit_Dependencies\Monolog\Formatter\FormatterInterface { if ($this->handler instanceof \Google\Site_Kit_Dependencies\Monolog\Handler\FormattableHandlerInterface) { return $this->handler->getFormatter(); } throw new \UnexpectedValueException('The nested handler of type ' . \get_class($this->handler) . ' does not support formatters.'); } }
Save