Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/LoggerZGW.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,39 @@ public function __construct(Logger $logger )
/**
* @since 1.0.0
*/
public function debug($message, array $context = array() ): void
public function debug(string $message, array $context = array() ): void
{
$this->add_record( Level::fromName( 'debug' )->value, $message, $context );
}

/**
* @since 1.0.0
*/
public function info($message, array $context = array() ): void
public function info(string $message, array $context = array() ): void
{
$this->add_record( Level::fromName( 'info' )->value, $message, $context );
}

/**
* @since 1.0.0
*/
public function notice($message, array $context = array() ): void
public function notice(string $message, array $context = array() ): void
{
$this->add_record( Level::fromName( 'notice' )->value, $message, $context );
}

/**
* @since 1.0.0
*/
public function warning($message, array $context = array() ): void
public function warning(string $message, array $context = array() ): void
{
$this->add_record( Level::fromName( 'warning' )->value, $message, $context );
}

/**
* @since 1.0.0
*/
public function error($message, array $context = array() ): void
public function error(string $message, array $context = array() ): void
{
$this->add_record( Level::fromName( 'error' )->value, $message, $context );
}
Expand All @@ -82,6 +82,8 @@ public function error($message, array $context = array() ): void
*/
protected function add_record(int $level, string $message, array $context = array() ): void
{
do_action('owcgfzgw::log-message/intercept', $message, $context);

if ( ! ( (bool) ContainerResolver::make()->get( 'message.logger.active' ) ) ) {
return;
}
Expand Down