FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Prototype/JavaScript/6-logger.js at master · HowProgrammingWorks/Prototype · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
HowProgrammingWorks
/
Prototype
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
28
Star
7
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Prototype
/
JavaScript
/
6-logger.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (22 loc) · 517 Bytes
Breadcrumbs
Prototype
/
JavaScript
/
6-logger.js
Copy path
File metadata and controls
27 lines (22 loc) · 517 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict'
;
const
logger
=
(
kind
)
=>
{
const
color
=
logger
.
colors
[
kind
]
||
logger
.
colors
.
info
;
return
(
s
)
=>
{
const
date
=
new
Date
(
)
.
toISOString
(
)
;
console
.
log
(
color
+
date
+
'\t'
+
s
)
;
}
;
}
;
logger
.
colors
=
{
warning
:
'\x1b[1;33m'
,
error
:
'\x1b[0;31m'
,
info
:
'\x1b[1;37m'
,
}
;
// Usage
const
warning
=
logger
(
'warning'
)
;
const
error
=
logger
(
'error'
)
;
const
debug
=
logger
(
'debug'
)
;
const
slow
=
logger
(
'slow'
)
;
slow
(
'I am slow logger'
)
;
warning
(
'Hello'
)
;
error
(
'World'
)
;
debug
(
'Bye!'
)
;
Back
|
FazBrowse Home
|
New Git URL