Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
马玮
/
carspider
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
81ae25d9
authored
Aug 25, 2017
by
mawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Find log issue
parent
05cf879a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
lib/DI.js
+1
-1
test.js
+22
-3
No files found.
lib/DI.js
100644 → 100755
View file @
81ae25d9
...
@@ -9,7 +9,7 @@ class DI {
...
@@ -9,7 +9,7 @@ class DI {
}
}
static
getLogger
()
{
static
getLogger
()
{
const
level
=
process
.
env
.
NODE_LOG_LEVEL
||
'
error
'
;
const
level
=
process
.
env
.
NODE_LOG_LEVEL
||
'
info
'
;
log4js
.
configure
({
log4js
.
configure
({
appenders
:
{
appenders
:
{
console
:
{
type
:
'console'
},
console
:
{
type
:
'console'
},
...
...
test.js
100644 → 100755
View file @
81ae25d9
...
@@ -11,19 +11,38 @@ const config = require('config');
...
@@ -11,19 +11,38 @@ const config = require('config');
async
function
t
()
{
async
function
t
()
{
return
't'
;
return
't'
;
}
}
const
DI
=
require
(
'./lib/DI'
);
const
logger
=
DI
.
getLogger
();
// new Buffer('hnmz147852.').toString('base64')
// new Buffer('hnmz147852.').toString('base64')
// new Buffer('Q2hlY2hlbmcyMzUj', 'base64').toString();
// new Buffer('Q2hlY2hlbmcyMzUj', 'base64').toString();
let
i
=
0
;
async
function
test
(
l
)
{
async
function
test
(
l
)
{
i
+=
1
;
await
Promise
.
delay
(
l
*
1000
).
then
(
async
function
()
{
await
Promise
.
delay
(
l
*
1000
).
then
(
async
function
()
{
console
.
log
(
'过了'
+
l
+
'秒'
);
logger
.
info
(
'过了'
+
l
+
'秒'
);
console
.
log
((
new
Date
()).
toLocaleString
());
logger
.
info
((
new
Date
()).
toLocaleString
());
console
.
log
(
'======================================='
);
logger
.
info
(
'======================================='
);
if
(
i
<
8
)
{
test
(
1
);
}
else
{
return
true
;
}
});
});
}
}
(
async
()
=>
{
(
async
()
=>
{
await
test
(
1
).
then
(
async
()
=>
{
await
DI
.
shutdownLogger
(
async
()
=>
{
console
.
log
(
'牛逼啊'
);
});
});
return
;
const
mt
=
await
t
();
const
mt
=
await
t
();
console
.
log
(
mt
);
console
.
log
(
mt
);
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment