Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
a0c1eab5
Commit
a0c1eab5
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix] #1292 Crash on Windows
parent
efe8992f
No related branches found
No related tags found
1 merge request
!1263
1.6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/logger.ts
+6
-0
6 additions, 0 deletions
app/lib/logger.ts
bin/duniter
+13
-12
13 additions, 12 deletions
bin/duniter
with
19 additions
and
12 deletions
app/lib/logger.ts
+
6
−
0
View file @
a0c1eab5
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
const
moment
=
require
(
'
moment
'
);
const
moment
=
require
(
'
moment
'
);
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
winston
=
require
(
'
winston
'
);
const
winston
=
require
(
'
winston
'
);
const
directory
=
require
(
'
../lib/system/directory
'
);
/***************
/***************
* CALLBACK LOGGER
* CALLBACK LOGGER
...
@@ -147,6 +148,11 @@ logger.unmute = () => {
...
@@ -147,6 +148,11 @@ logger.unmute = () => {
}
}
}
}
/**
* Default logging path
*/
logger
.
addHomeLogs
(
directory
.
INSTANCE_HOME
)
/**
/**
* Convenience function to get logger directly
* Convenience function to get logger directly
*/
*/
...
...
This diff is collapsed.
Click to expand it.
bin/duniter
+
13
−
12
View file @
a0c1eab5
...
@@ -2,27 +2,28 @@
...
@@ -2,27 +2,28 @@
"
use strict
"
;
"
use strict
"
;
const
co
=
require
(
'
co
'
);
const
co
=
require
(
'
co
'
);
const
duniter
=
require
(
'
../index
'
);
const
logger
=
require
(
"
../app/lib/logger
"
).
NewLogger
();
const
stack
=
duniter
.
statics
.
autoStack
();
return
co
(
function
*
()
{
// Specific errors handling
process
.
on
(
'
uncaughtException
'
,
(
err
)
=>
{
// Dunno why this specific exception is not caught
if
(
err
.
code
&&
err
.
code
!==
"
EADDRNOTAVAIL
"
&&
err
.
code
!==
"
EINVAL
"
&&
err
.
code
!==
"
ENOENT
"
)
{
logger
.
error
(
err
.
stack
||
err
.
message
||
err
);
process
.
exit
(
2
);
}
});
// Specific errors handling
return
co
(
function
*
()
{
process
.
on
(
'
uncaughtException
'
,
(
err
)
=>
{
// Dunno why this specific exception is not caught
if
(
err
.
code
!==
"
EADDRNOTAVAIL
"
&&
err
.
code
!==
"
EINVAL
"
&&
err
.
code
!==
"
ENOENT
"
)
{
duniter
.
statics
.
logger
.
error
(
err
);
process
.
exit
(
2
);
}
});
try
{
try
{
const
duniter
=
require
(
'
../index
'
);
const
stack
=
duniter
.
statics
.
autoStack
();
yield
stack
.
executeStack
(
process
.
argv
);
yield
stack
.
executeStack
(
process
.
argv
);
// Everything went well, close Duniter quietly.
// Everything went well, close Duniter quietly.
process
.
exit
();
process
.
exit
();
}
catch
(
e
)
{
}
catch
(
e
)
{
// If an unhandled error occured
// If an unhandled error occured
duniter
.
statics
.
logger
.
error
(
e
);
logger
.
error
(
e
.
stack
||
e
.
message
||
e
);
process
.
exit
(
1
);
process
.
exit
(
1
);
}
finally
{
}
finally
{
// If we did not succeed to close before, force close with error.
// If we did not succeed to close before, force close with error.
...
...
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