Skip to content

Commit

Permalink
Added loggerLevel to changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcole1340 committed Apr 22, 2021
1 parent 4622773 commit c11af7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This version has also been known as `v5.2.0`, however, breaking changes caused t
- With the update to gateway version 8, the `GUILD_MEMBER` and `PRESENCE_UPDATE` intents are not enabled by default.
- You must first enable these in your Discord developer portal before enabling them in DiscordPHP. See the documentation for an example.
- The `loadAllMembers` option requires the `GUILD_MEMBER` intent to be enabled.
- The `logging` and `httpLogger` options have been removed.
- The `logging`, `httpLogger` and `loggerLevel` options have been removed.
- All HTTP logging information is now redirected to the `logger` that you have passed, or the default logger.
- For people that disabled logging by setting `logging` to false, you can create a logger with a [`NullHandler`](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/NullHandler.php).
- For voice client users, see the section below for breaking changes.
Expand Down
21 changes: 19 additions & 2 deletions V6_CONVERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP 7.4 is now required. Please update to _at least_ PHP 7.4, but we recommend P

## Options removal

The `logging` and `httpLogger` options have been removed. Any logs that went to the HTTP logger are now sent to the default `logger`.
The `logging`, `httpLogger` and `loggerLevel` options have been removed. Any logs that went to the HTTP logger are now sent to the default `logger`.

If you were using the `logging` option to disable logging, you can do the same by creating a null logger:

Expand All @@ -26,6 +26,23 @@ $discord = new Discord([
]);
```

If you were using the `loggerLevel` option to change the logger level, you can do the same by creating a logger and changing the level of the handler:

```php
<?php

use Discord\Discord;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('Logger');
$logger->pushHandler(new StreamHandler('php://stdout'), Logger::DEBUG); // Change the second parameter of this function call.
$discord = new Discord([
// ...
'logger' => $logger,
]);
```

## Loading all members

Alongside the `loadAllMembers` option, you now must enable the `GUILD_MEMBERS` intent. You can do this by specifying the `intents` option in the options array:
Expand Down Expand Up @@ -90,4 +107,4 @@ Copied from the changelog:
- `stop()`
- `close()`
- `getRecieveStream()`
- Expect a voice client refactor in a future release.
- Expect a voice client refactor in a future release.

0 comments on commit c11af7c

Please sign in to comment.