class LagoonLogsLoggerFactory in Lagoon Logs 8
Hierarchy
- class \Drupal\lagoon_logs\Logger\LagoonLogsLoggerFactory
Expanded class hierarchy of LagoonLogsLoggerFactory
1 file declares its use of LagoonLogsLoggerFactory
File
- src/
Logger/ LagoonLogsLoggerFactory.php, line 8
Namespace
Drupal\lagoon_logs\LoggerView source
class LagoonLogsLoggerFactory {
const LAGOON_LOGS_DEFAULT_SAFE_BRANCH = 'safe_branch_unset';
const LAGOON_LOGS_DEFAULT_LAGOON_PROJECT = 'project_unset';
public static function create(ConfigFactoryInterface $config, LogMessageParserInterface $parser) {
$host = $config
->get('lagoon_logs.settings')
->get('host');
$port = $config
->get('lagoon_logs.settings')
->get('port');
return new LagoonLogsLogger($host, $port, self::getHostProcessIndex($config), $parser);
}
public static function getHostProcessIndex(ConfigFactoryInterface $config) {
return implode('-', [
getenv('LAGOON_PROJECT') ?: self::LAGOON_LOGS_DEFAULT_LAGOON_PROJECT,
getenv('LAGOON_GIT_SAFE_BRANCH') ?: self::LAGOON_LOGS_DEFAULT_SAFE_BRANCH,
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LagoonLogsLoggerFactory:: |
public static | function | ||
LagoonLogsLoggerFactory:: |
public static | function | ||
LagoonLogsLoggerFactory:: |
constant | |||
LagoonLogsLoggerFactory:: |
constant |