Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPLIB-1243: Renamed add_logger() and remove_logger() functions #1177

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* Calling this method again with a logger that has already been added will have
* no effect.
*/
function addLogger(LoggerInterface $logger): void
function add_logger(LoggerInterface $logger): void
{
PsrLogAdapter::addLogger($logger);
}
Expand All @@ -64,7 +64,7 @@ function addLogger(LoggerInterface $logger): void
* Calling this method with a logger that has not been added will have no
* effect.
*/
function removeLogger(LoggerInterface $logger): void
function remove_logger(LoggerInterface $logger): void
{
PsrLogAdapter::removeLogger($logger);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/LogNonGenuineHostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Psr\Log\LoggerInterface;

use function func_get_args;
use function MongoDB\addLogger;
use function MongoDB\removeLogger;
use function MongoDB\add_logger;
use function MongoDB\remove_logger;

/** @see https://jira.mongodb.org/browse/DRIVERS-2583 */
class LogNonGenuineHostTest extends TestCase
Expand All @@ -20,12 +20,12 @@ public function setUp(): void
{
$this->logger = $this->createTestPsrLogger();

addLogger($this->logger);
add_logger($this->logger);
}

public function tearDown(): void
{
removeLogger($this->logger);
remove_logger($this->logger);
}

/** @dataProvider provideCosmosUris */
Expand Down
8 changes: 4 additions & 4 deletions tests/PsrLogAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
use Psr\Log\LogLevel;

use function func_get_args;
use function MongoDB\addLogger;
use function MongoDB\add_logger;
use function MongoDB\Driver\Monitoring\mongoc_log;
use function MongoDB\removeLogger;
use function MongoDB\remove_logger;
use function sprintf;

class PsrLogAdapterTest extends BaseTestCase
Expand All @@ -39,12 +39,12 @@ public function testAddAndRemoveLoggerFunctions(): void
mongoc_log(LogSubscriber::LEVEL_INFO, 'domain1', 'info1');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain2', 'info2');

addLogger($logger);
add_logger($logger);

mongoc_log(LogSubscriber::LEVEL_INFO, 'domain3', 'info3');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain4', 'info4');

removeLogger($logger);
remove_logger($logger);

mongoc_log(LogSubscriber::LEVEL_INFO, 'domain5', 'info5');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain6', 'info6');
Expand Down