You are here

public function BufferLogger::__construct in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Logger/BufferLogger.php \Drupal\tmgmt_smartling\Logger\BufferLogger::__construct()
  2. 8.2 src/Logger/BufferLogger.php \Drupal\tmgmt_smartling\Logger\BufferLogger::__construct()

BufferLogger constructor.

Parameters

Client $http_client:

LogMessageParserInterface $parser:

ConfigFactoryInterface $config_factory:

RequestStack $request_stack:

array $channels:

int $log_level:

string $host:

int $buffer_limit:

int $time_out:

File

src/Logger/BufferLogger.php, line 120

Class

BufferLogger
Class BufferLogger

Namespace

Drupal\tmgmt_smartling\Logger

Code

public function __construct(Client $http_client, LogMessageParserInterface $parser, ConfigFactoryInterface $config_factory, RequestStack $request_stack, $channels = [
  'tmgmt_smartling',
  'tmgmt_smartling_context_debug',
  'tmgmt_extension_suit',
  'smartling_api',
], $log_level = RfcLogLevel::DEBUG, $host = 'https://api.smartling.com/updates/status', $buffer_limit = 100, $time_out = 5) {
  $this->buffer = [];
  $this->httpClient = $http_client;
  $this->channels = $channels;
  $this->parser = $parser;
  $this->configFactory = $config_factory;
  $this->requestStack = $request_stack;
  $this->logLevel = $log_level;
  $this->host = $host;
  $this->bufferLimit = $buffer_limit;
  $this->timeOut = $time_out;
  $this->uid = uniqid();
  drupal_register_shutdown_function([
    $this,
    'flush',
  ]);
}