mirror of
https://github.com/friendica/friendica
synced 2025-05-03 17:04:09 +02:00
Remove DependencyFactory
- Include all necessary classes in `dependencies.config.php` - Add DI-reference to BaseObject (acts as a global registry) - Refactor all static "init()" methods to use the global registry - Refactor Logging for Worker-Logger a little bit
This commit is contained in:
parent
8b344141da
commit
6c2cf494b5
21 changed files with 188 additions and 280 deletions
|
@ -31,13 +31,23 @@ class WorkerLogger implements LoggerInterface
|
|||
* @param string $functionName The current function name of the worker
|
||||
* @param int $idLength The length of the generated worker ID
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger, $functionName, $idLength = 7)
|
||||
public function __construct(LoggerInterface $logger, $functionName = '', $idLength = 7)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
$this->functionName = $functionName;
|
||||
$this->workerId = Strings::getRandomHex($idLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the function name for additional logging
|
||||
*
|
||||
* @param string $functionName
|
||||
*/
|
||||
public function setFunctionName(string $functionName)
|
||||
{
|
||||
$this->functionName = $functionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the worker context for each log entry
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue