Skip to content

Commit e909ae3

Browse files
authored
Merge pull request #53 from noplanman/no_logging_error
Prevent deprecation notices if logging is disabled.
2 parents 53920d0 + 9c69179 commit e909ae3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1515
- Botan.io has been removed (see php-telegram-bot/core#924). (#50)
1616
### Fixed
1717
- Fix and improve getUpdates output.
18+
- Don't output deprecation notices if no logging is enabled.
1819
### Security
1920
- Security disclosure managed by [Tidelift]. (#49)
2021

src/BotManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function run(): self
171171
*/
172172
public function initLogging(array $log_paths): self
173173
{
174-
self::inTest() || trigger_error(__METHOD__ . ' is deprecated and will be removed soon. Initialise with a preconfigured logger instance instead using "TelegramLog::initialize($logger)".', E_USER_DEPRECATED);
174+
empty($log_paths) || self::inTest() || trigger_error(__METHOD__ . ' is deprecated and will be removed soon. Initialise with a preconfigured logger instance instead using "TelegramLog::initialize($logger)".', E_USER_DEPRECATED);
175175

176176
foreach ($log_paths as $logger => $logfile) {
177177
('debug' === $logger) && TelegramLog::initDebugLog($logfile);

0 commit comments

Comments
 (0)