@param LogConnectWorkspace $log
@param array               $options

@return array
968694
public function serialize(LogConnectWorkspace $log, array $options = [])
    {
        $serialized = [
            'id' => $log->getUuid(),
            'date' => $log->getConnectionDate()->format('Y-m-d\TH:i:s'),
            'duration' => $log->getDuration(),
            'user' => $this->serializer->serialize($log->getUser(), [Options::SERIALIZE_MINIMAL]),
            'workspace' => $this->serializer->serialize($log->getWorkspace(), [Options::SERIALIZE_MINIMAL]),
            'workspaceName' => $log->getWorkspaceName(),
        ];

        return $serialized;
    }
758961
public function serialize(Blog $blog, array $options = [])
    {
        return [
            'id' => $blog->getUuid(),
            'name' => $blog->getResourceNode()->getName(),
            'infos' => $blog->getInfos(),
            'options' => $this->blogOptionsSerializer->serialize($blog, $blog->getOptions()),
        ];
    }
691919
public function getSearchOptions($table, string $field, array $options = []) : array
    {
        $handler = self::getByTableField($table, $field, $options, $this->cakeView);

        return $handler->getSearchOptions($options);
    }
606466
private function getLogFile(Workspace $workspace)
    {
        $fs = new Filesystem();
        $fs->mkDir($this->logDir);

        return $this->logDir.DIRECTORY_SEPARATOR.$workspace->getCode().'.json';
    }
108170
private function configureDeliveryOptions(array $options): array
    {
        $logger = $options['options']['logger'];
        if (\null !== $logger) {
            $options['options']['logger'] = \true === $logger
                ? new Reference(LoggerInterface::class)
                : new Reference($options['options']['logger']);
        }

        if (\null !== $options['options']['client']) {
            $options['options']['client'] = new Reference($options['options']['client']);
        }

        $pool = $options['options']['cache']['pool'];
        if (\null !== $pool) {
            $options['options']['cache']['pool'] = \true === $pool
                ? new Reference(CacheItemPoolInterface::class)
                : new Reference($pool);
        }

        return $options;
    }
887004
public function beforeLog(Event $event, array $logs)
    {
        $meta = [
            'ip' => $this->request->clientIp(),
            'url' => $this->request->getRequestTarget(),
            'user' => $this->user
        ];

        foreach ($logs as $log) {
            $log->setMetaInfo($log->getMetaInfo() + $meta);
        }
    }
1195886
public function specEnd($log = null)
    {
        $isOk = $log->passed() ? "ok" : "not ok";

        switch ($log->type()) {
            case 'skipped':
            case 'pending':
            case 'excluded':
                $prefix = "# {$log->type()} ";
                break;
            default:
                $prefix = '- ';
                break;
        }
        $message = $prefix . trim(implode(" ", $log->messages()));
        $this->_counter++;

        $this->write("{$isOk} {$this->_counter} {$message}\n");

        if ($exception = $log->exception()) {
            $this->write('# Exception: `' . get_class($exception) .'` Code(' . $exception->getCode() . '):' . "\n");
            $this->write('# Message: ' . $exception->getMessage() . "\n");
        } else {
            foreach ($log->children() as $log) {
                if ($log->passed()) {
                    continue;
                }
                $toString = function ($instance) {
                    return 'an instance of `' . get_class($instance) . '`';
                };
                foreach ($log->data() as $key => $value) {
                    $key = ucfirst($key);
                    $value = Text::toString($value, ['object' => ['method' => $toString]]);
                    $this->write("# {$key}: {$value}\n");
                }
            }
        }
    }
1341222
public function logEvents(array $auditLogs)
    {
        $this->connection()->send(
            $this->options['exchange'],
            $this->options['routing'],
            $auditLogs,
            ['delivery_mode' => $this->options['delivery_mode']]
        );
    }
1266206
protected function resolveOptions(array $options = [])
    {
        $resolver = new OptionsResolver();
        $logger   = new Monolog('DiscordPHP');

        $resolver
            ->setRequired('token')
            ->setAllowedTypes('token', 'string')
            ->setDefined([
                'token',
                'bot',
                'shardId',
                'shardCount',
                'loop',
                'logger',
                'loggerLevel',
                'logging',
                'cachePool',
                'loadAllMembers',
                'disabledEvents',
                'pmChannels',
                'storeMessages',
                'retrieveBans',
            ])
            ->setDefaults([
                'loop'           => LoopFactory::create(),
                'bot'            => true,
                'logger'         => null,
                'loggerLevel'    => Monolog::INFO,
                'logging'        => true,
                'cachePool'      => new ArrayCachePool(),
                'loadAllMembers' => false,
                'disabledEvents' => [],
                'pmChannels'     => false,
                'storeMessages'  => false,
                'retrieveBans'   => true,
            ])
            ->setAllowedTypes('bot', 'bool')
            ->setAllowedTypes('loop', LoopInterface::class)
            ->setAllowedTypes('logging', 'bool')
            ->setAllowedTypes('cachePool', CacheItemPoolInterface::class)
            ->setAllowedTypes('loadAllMembers', 'bool')
            ->setAllowedTypes('disabledEvents', 'array')
            ->setAllowedTypes('pmChannels', 'bool')
            ->setAllowedTypes('storeMessages', 'bool')
            ->setAllowedTypes('retrieveBans', 'bool');

        $options = $resolver->resolve($options);

        if (is_null($options['logger'])) {
            $logger->pushHandler(new StreamHandler('php://stdout', $options['loggerLevel']));
            $options['logger'] = $logger;
        }

        return $options;
    }
1093728
protected function sortLogEntry($log_entry, $issue_api, $changes) {
    $sorted = FALSE;
    $github_issue_number = $this->parseGitHubIssueNumber($log_entry);
    if ($github_issue_number) {
      $labels = $this->getGitHubIssueLabels($issue_api, $github_issue_number);
      if ($labels) {
        foreach ($labels as $label) {
          if (strtolower($label['name']) == 'change record') {
            $changes['breaking'][] = $log_entry;
            $sorted = TRUE;
            break;
          }
          elseif (strtolower($label['name']) == 'enhancement') {
            $changes['enhancements'][] = $log_entry;
            $sorted = TRUE;
            break;
          }
          elseif (strtolower($label['name']) == 'bug') {
            $changes['bugs'][] = $log_entry;
            $sorted = TRUE;
            break;
          }
        }
      }
    }
    if (!$sorted) {
      $changes['misc'][] = $log_entry;
    }
    return $changes;
  }
81177
public static function userCanOnLogs( $log , $action , $value , $username = null)
	{
		if ( is_null( $username ) ) $username = self::getCurrentUsername();
		if ( is_null( $username ) ) return false;
		if ( ! self::userExists( $username ) ) return false;
		if ( in_array( 'admin' , self::$auth['users'][ $username ]['roles'] ) ) return true;
		if ( ! isset( self::$auth['users'][ $username ]['logs'][ $log ][ $action ] ) ) return false;
		return ( self::$auth['users'][ $username ]['logs'][ $log ][ $action ] === $value );
	}
516306
function(options)
    {
      var logTag = options.logLevel;
      if (Util.exists(logTag))
      {
        // check that the specified value is a valid tag
        Errors.checkArgumentValid(LoggerCore.isValidLogTag(logTag),
            ErrorCodes.ERR_GLOGAL_CONFIGURE_INVALID_LOG_LEVEL);

        Logger.getInstance().configure(
        {
          level: LoggerCore.logTagToLevel(logTag)
        });
      }

      var insecureConnect = options.insecureConnect;
      if (Util.exists(insecureConnect))
      {
        // check that the specified value is a boolean
        Errors.checkArgumentValid(Util.isBoolean(insecureConnect),
            ErrorCodes.ERR_GLOBAL_CONFIGURE_INVALID_INSECURE_CONNECT);

        GlobalConfig.setInsecureConnect(insecureConnect);
      }
    }
748481
protected function _log($contents, $log) {
		$config = [
			'level' => LOG_DEBUG,
			'scope' => 'email',
		];
		if ($log !== true) {
			if (!is_array($log)) {
				$log = ['level' => $log];
			}
			$config = array_merge($config, $log);
		}

		Log::write(
			$config['level'],
			PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
			$config['scope']
		);
	}
99793
public function getActivity($log, $page = 1, $amount = 10, $options = [])
    {
        if ($log == 'change') {
            $repo = $this->changeRepository;
        } elseif ($log == 'system') {
            $repo = $this->systemRepository;
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }

        try {
            $rows = $repo->getActivity($page, $amount, $options);
            $rowcount = $repo->getActivityCount($options);
        } catch (TableNotFoundException $e) {
            return null;
        }

        // Set up the pager

        /** @var \Bolt\Pager\PagerManager $manager */
        $manager = $this->app['pager'];
        $manager->createPager('activity')
            ->setCount($rowcount)
            ->setTotalpages(ceil($rowcount / $amount))
            ->setCurrent($page)
            ->setShowingFrom(($page - 1) * $amount + 1)
            ->setShowingTo(($page - 1) * $amount + count($rows));

        return $rows;
    }
997883
public static function get_query_log($connection_name = self::DEFAULT_CONNECTION)
        {
            if (isset(self::$_query_log[$connection_name])) {
                return self::$_query_log[$connection_name];
            }

            return [];
        }
198937
protected function _addNamespaces($names, array $namespaces, array &$logs = array())
    {
        if (!is_array($names)) {
            $names = array($names);
        }
        $return_names = array();
        foreach ($names as $_name) {
            foreach ($namespaces as $_namespace) {
                if (CodeHelper::namespaceExists($_namespace)) {
                    $tmp_namespace = rtrim(TextHelper::toCamelCase($_namespace), '\\').'\\';
                    $return_names[] = $tmp_namespace.str_replace($tmp_namespace, '', TextHelper::toCamelCase($_name));
                } else {
                    $logs[] = $this->_getErrorMessage('Namespace "%s" not found!', $_namespace);
                }
            }
        }
        return $return_names;
    }
222027
public abstract function __construct(LoggerInterface $log, $username, $password, $options = []);

    /**
     * Debug logging of input/output from API calls
     *
     * @param array $data     API input
     * @param mixed $response Response from API
     */
    public function _handleError($data, $response)
    {
        $this->output->debug('Class: ' . get_class($this));
        $this->output->debug('Request: ');
        $this->output->debug('**********');
        $this->output->debug(print_r($data, true));
        $this->output->debug('**********');
        $this->output->debug('Response: ');
        $this->output->debug('**********');
        $this->output->debug(print_r($response, true));
        $this->output->debug('**********');
    }