Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-logs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-logs
Commits
67c93eed
Commit
67c93eed
authored
6 years ago
by
dyszczo
Browse files
Options
Downloads
Patches
Plain Diff
WC integration now considers broken WC_Logger implementation
parent
47744abb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!8
Feature/broken wc logger
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
src/WC/WooCommerceCapture.php
+1
-1
1 addition, 1 deletion
src/WC/WooCommerceCapture.php
src/WC/WooCommerceMonologPlugin.php
+154
-128
154 additions, 128 deletions
src/WC/WooCommerceMonologPlugin.php
with
159 additions
and
129 deletions
CHANGELOG.md
+
4
−
0
View file @
67c93eed
## [1.4.0] - 2019-01-21
### Changed
-
WC integration now considers broken WC_Logger implementation
## [1.3.1] - 2018-10-30
### Changed
-
setDisableLog changes to disableLog
...
...
This diff is collapsed.
Click to expand it.
src/WC/WooCommerceCapture.php
+
1
−
1
View file @
67c93eed
...
...
@@ -65,7 +65,7 @@ class WooCommerceCapture
if
(
$this
->
captureHookFunction
===
null
)
{
$this
->
captureHookFunction
=
function
()
use
(
$monolog
)
{
return
new
WooCommerceMonologPlugin
(
$monolog
);
return
new
WooCommerceMonologPlugin
(
$monolog
,
$this
->
originalWCLogger
);
};
$this
->
monolog
->
pushHandler
(
new
WooCommerceHandler
(
$this
->
originalWCLogger
));
}
...
...
This diff is collapsed.
Click to expand it.
src/WC/WooCommerceMonologPlugin.php
+
154
−
128
View file @
67c93eed
...
...
@@ -12,13 +12,37 @@ use WC_Log_Levels;
*
* @package WPDesk\Logger
*/
class
WooCommerceMonologPlugin
implements
\WC_Logger_Interface
{
class
WooCommerceMonologPlugin
implements
\WC_Logger_Interface
{
/** @var Logger */
private
$monolog
;
public
function
__construct
(
Logger
$monolog
)
{
/** @var \WC_Logger */
private
$originalWCLogger
;
public
function
__construct
(
Logger
$monolog
,
\WC_Logger
$originalLogger
)
{
$this
->
monolog
=
$monolog
;
$this
->
originalWCLogger
=
$originalLogger
;
}
/**
* Method added for compatibility with \WC_Logger
*
* @param string $source
*/
public
function
clear
(
$source
=
''
)
{
$this
->
originalWCLogger
->
clear
(
$source
);
}
/**
* Method added for compatibility with \WC_Logger
*/
public
function
clear_expired_logs
()
{
$this
->
originalWCLogger
->
clear_expired_logs
();
}
/**
...
...
@@ -31,7 +55,8 @@ class WooCommerceMonologPlugin implements \WC_Logger_Interface {
*
* @deprecated
*/
public
function
add
(
$handle
,
$message
,
$level
=
WC_Log_Levels
::
NOTICE
)
{
public
function
add
(
$handle
,
$message
,
$level
=
WC_Log_Levels
::
NOTICE
)
{
$this
->
log
(
$message
,
$level
);
}
...
...
@@ -48,7 +73,8 @@ class WooCommerceMonologPlugin implements \WC_Logger_Interface {
$this
->
log
(
LogLevel
::
EMERGENCY
,
$message
,
$context
);
}
public
function
log
(
$level
,
$message
,
$context
=
[]
)
{
public
function
log
(
$level
,
$message
,
$context
=
[])
{
$this
->
monolog
->
log
(
$level
,
$message
,
$context
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment