Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
5002857e
Unverified
Commit
5002857e
authored
Jul 16, 2019
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't output deprecation error if no logging is enabled, allow more logging flexibility.
parent
80f626f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
CHANGELOG.md
CHANGELOG.md
+2
-0
TelegramLog.php
src/TelegramLog.php
+6
-5
No files found.
CHANGELOG.md
View file @
5002857e
...
...
@@ -8,9 +8,11 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
-
[
:ledger: View file changes
][
Unreleased
]
### Added
### Changed
-
Logging only updates or only debug/errors is now possible.
### Deprecated
### Removed
### Fixed
-
Don't output deprecation notices if no logging is enabled.
### Security
## [0.59.0] - 2019-07-07
...
...
src/TelegramLog.php
View file @
5002857e
...
...
@@ -88,8 +88,8 @@ class TelegramLog
*/
public
static
function
initialize
(
LoggerInterface
$logger
=
null
,
LoggerInterface
$update_logger
=
null
)
{
if
(
$logger
===
null
&&
$update_logger
===
null
)
{
// Clearly deprecated code still being executed.
if
(
$logger
===
null
)
{
(
defined
(
'PHPUNIT_TESTSUITE'
)
&&
PHPUNIT_TESTSUITE
)
||
trigger_error
(
'A PSR-3 compatible LoggerInterface object must be provided. Initialise with a preconfigured logger instance.'
,
E_USER_DEPRECATED
);
$logger
=
new
Logger
(
'bot_log'
);
}
elseif
(
$logger
instanceof
Logger
)
{
...
...
@@ -286,11 +286,12 @@ class TelegramLog
}
elseif
(
$name
===
'update'
)
{
$logger
=
self
::
$update_logger
;
$name
=
'info'
;
}
else
{
return
;
}
self
::
initialize
(
self
::
$logger
,
self
::
$update_logger
);
// Clearly we have no logging enabled.
if
(
$logger
===
null
)
{
return
;
}
// Replace any placeholders from the passed context.
if
(
count
(
$arguments
)
>=
2
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment