Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
log
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libs
log
Commits
f780b828
Commit
f780b828
authored
6 years ago
by
admin-sigmundd
Browse files
Options
Downloads
Patches
Plain Diff
Added tags FATAL and NOTICE
parent
ecb7053e
No related branches found
No related tags found
1 merge request
!1
Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
index.js
+18
-0
18 additions, 0 deletions
index.js
samples/all-options.js
+2
-0
2 additions, 0 deletions
samples/all-options.js
samples/log-to-file.js
+2
-0
2 additions, 0 deletions
samples/log-to-file.js
samples/no-options.js
+3
-1
3 additions, 1 deletion
samples/no-options.js
with
27 additions
and
1 deletion
README.md
+
2
−
0
View file @
f780b828
...
...
@@ -17,8 +17,10 @@ Note: The options Part may be omitted, as all parts are optional, but using the
### Methods
*
`log.info('This is an Information')`
*
`log.notice('This is a Notice')`
*
`log.warn('This is a Warning')`
*
`log.error('This is an Error')`
*
`log.fatal('This is a Fatal Message')`
*
`log.debug('This is a Debug Message')`
### Options
...
...
This diff is collapsed.
Click to expand it.
index.js
+
18
−
0
View file @
f780b828
...
...
@@ -19,6 +19,12 @@ function Log (options) {
this
.
info
=
function
(
message
)
{
this
.
log
(
'
INFO
'
,
message
)
}
this
.
notice
=
function
(
message
)
{
this
.
log
(
'
NOTICE
'
,
message
)
}
this
.
fatal
=
function
(
message
)
{
this
.
log
(
'
FATAL
'
,
message
)
}
this
.
warn
=
function
(
message
)
{
this
.
log
(
'
WARN
'
,
message
)
}
...
...
@@ -34,12 +40,18 @@ function Log (options) {
case
'
INFO
'
:
console
.
log
(
msg
)
break
case
'
NOTICE
'
:
console
.
log
(
msg
)
break
case
'
WARN
'
:
console
.
warn
(
msg
)
break
case
'
ERROR
'
:
console
.
error
(
msg
)
break
case
'
FATAL
'
:
console
.
error
(
msg
)
break
case
'
DEBUG
'
:
console
.
log
(
msg
)
break
...
...
@@ -54,12 +66,18 @@ function Log (options) {
case
'
INFO
'
:
this
.
graylogger
.
info
(
message
)
break
case
'
NOTICE
'
:
this
.
graylogger
.
notice
(
message
)
break
case
'
WARN
'
:
this
.
graylogger
.
warning
(
message
)
break
case
'
ERROR
'
:
this
.
graylogger
.
error
(
message
)
break
case
'
FATAL
'
:
this
.
graylogger
.
critical
(
message
)
break
case
'
DEBUG
'
:
this
.
graylogger
.
debug
(
message
)
break
...
...
This diff is collapsed.
Click to expand it.
samples/all-options.js
+
2
−
0
View file @
f780b828
...
...
@@ -6,6 +6,8 @@ let log = new Log({
})
log
.
info
(
'
This is an Information
'
)
log
.
notice
(
'
This is a Notice
'
)
log
.
warn
(
'
This is a Warning
'
)
log
.
error
(
'
This is an Error
'
)
log
.
fatal
(
'
This is a Fatal Message
'
)
log
.
debug
(
'
This is a Debug Message
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
samples/log-to-file.js
+
2
−
0
View file @
f780b828
...
...
@@ -6,6 +6,8 @@ let log = new Log({
})
log
.
info
(
'
This is an Information
'
)
log
.
notice
(
'
This is a Notice
'
)
log
.
warn
(
'
This is a Warning
'
)
log
.
error
(
'
This is an Error
'
)
log
.
fatal
(
'
This is a Fatal Message
'
)
log
.
debug
(
'
This is a Debug Message
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
samples/no-options.js
+
3
−
1
View file @
f780b828
...
...
@@ -3,6 +3,8 @@ const Log = require('../index.js')
let
log
=
new
Log
()
log
.
info
(
'
This is an Information
'
)
log
.
notice
(
'
This is a Notice
'
)
log
.
warn
(
'
This is a Warning
'
)
log
.
error
(
'
This is an Error
'
)
log
.
debug
(
'
This is a Debug Message
'
)
log
.
fatal
(
'
This is a Fatal Message
'
)
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