Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
php-logger
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a606612c
authored
Aug 31, 2024
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add log level
1 parent
21aa8f4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
Logger.php
Logger.php
View file @
a606612
...
...
@@ -93,7 +93,7 @@ class Logger
}
else
{
$log_string
=
$string
;
}
$this
->
do_write
(
$log_string
,
$log_source
);
$this
->
do_write
(
$log_string
,
$log_source
,
"info"
);
}
/*
...
...
@@ -120,9 +120,9 @@ class Logger
*
* $access public
* */
public
function
do_write
(
$log_string
,
$log_source
)
public
function
do_write
(
$log_string
,
$log_source
,
$log_level
=
'debug'
)
{
$log_string
=
sprintf
(
"%s
%s -- %s"
,
date
(
DATESTRING_FULL
),
$log_string
,
$log_source
);
$log_string
=
sprintf
(
"%s
[%s] %s -- %s"
,
date
(
DATESTRING_FULL
),
str_pad
(
strtoupper
(
$log_level
),
5
),
$log_string
,
$log_source
);
$log_string
=
$log_string
.
PHP_EOL
;
if
(
$this
->
user_handle
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment