Skip to content

Commit

Permalink
Merge pull request #14 from softonic/Allow-logs-for-outgoing-and-inco…
Browse files Browse the repository at this point in the history
…ming-protobuf-messages

 Fixed default logger initialization
  • Loading branch information
xaviapa authored Mar 4, 2024
2 parents dfb2a61 + 1a94d19 commit 253a3b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM softonic/composer-rector:latest
FROM composer/composer:2.4.0

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/

Expand Down
4 changes: 2 additions & 2 deletions src/ExternalEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

class ExternalEvents
{
public static ?LoggerInterface $logger;
public static ?LoggerInterface $logger = null;

public static ?LogMessageFormatterInterface $formatter;
public static ?LogMessageFormatterInterface $formatter = null;

private const CAMEL_CASE_LETTERS_DETECTION = '#(?!(?<=^)|(?<=\\\))[A-Z]#';

Expand Down
8 changes: 4 additions & 4 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public function boot()
],
'config'
);

if (ExternalEvents::$logger === null) {
ExternalEvents::setLogger(new NullLogger());
}
}

/**
Expand All @@ -32,5 +28,9 @@ public function boot()
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../config/' . $this->packageName . '.php', $this->packageName);

if (ExternalEvents::$logger === null) {
ExternalEvents::setLogger(new NullLogger());
}
}
}

0 comments on commit 253a3b0

Please sign in to comment.