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
4a8c2d13
Commit
4a8c2d13
authored
6 years ago
by
dyszczo
Browse files
Options
Downloads
Patches
Plain Diff
added tearDown for static varable testing
parent
7101cd26
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!3
Devel
,
!2
Feature/tests
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/WPDeskLoggerFactory.php
+30
-20
30 additions, 20 deletions
src/WPDeskLoggerFactory.php
with
30 additions
and
20 deletions
src/WPDeskLoggerFactory.php
+
30
−
20
View file @
4a8c2d13
...
...
@@ -27,6 +27,16 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
/** @var bool */
private
static
$isWpdeskLogWorking
=
false
;
/**
* Remove static instances. In general should be use only testing purposes.
*/
public
static
function
tearDown
()
{
if
(
Registry
::
hasLogger
(
self
::
WPDESK_LOGGER_CHANNEL_NAME
))
{
Registry
::
removeLogger
(
self
::
WPDESK_LOGGER_CHANNEL_NAME
);
}
self
::
$isWpdeskLogWorking
=
false
;
}
/**
* Creates default WPDesk logger.
*
...
...
@@ -65,26 +75,6 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
return
$logger
;
}
/**
* is WPDesk file log is working(writable, exists, connected).
*
* @return bool
*/
public
function
isWPDeskLogWorking
()
{
return
self
::
$isWpdeskLogWorking
;
}
/**
* Returns WPDesk filename with path.
*
* @return string
*/
public
function
getWPDeskFileName
()
{
return
WP_CONTENT_DIR
.
'/uploads/wpdesk-logs/wpdesk_debug.log'
;
}
/**
* According to WPDesk - use logger only when debug mode is enabled.
*
...
...
@@ -141,4 +131,24 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
$filename
=
$this
->
getWPDeskFileName
();
$logger
->
pushHandler
(
new
StreamHandler
(
$filename
,
self
::
LEVEL_WPDESK_FILE
));
}
/**
* Returns WPDesk filename with path.
*
* @return string
*/
public
function
getWPDeskFileName
()
{
return
WP_CONTENT_DIR
.
'/uploads/wpdesk-logs/wpdesk_debug.log'
;
}
/**
* is WPDesk file log is working(writable, exists, connected).
*
* @return bool
*/
public
function
isWPDeskLogWorking
()
{
return
self
::
$isWpdeskLogWorking
;
}
}
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