Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/improvement/CLDSRV-544-stderr' i…
Browse files Browse the repository at this point in the history
…nto w/7.70/improvement/CLDSRV-544-stderr
  • Loading branch information
BourgoisMickael committed Jul 1, 2024
2 parents c0fe0cf + cd9e2e7 commit 7305b11
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'; // eslint-disable-line strict

/**
* Catch uncaught exceptions and add timestamp to aid debugging
*/
process.on('uncaughtException', err => {
process.stderr.write(`${new Date().toISOString()}: Uncaught exception: \n${err.stack}`);
});
require('werelogs').stderrUtils.catchAndTimestampStderr(
undefined,
// Do not exit as workers have their own listener that will exit
// But primary don't have another listener
require('cluster').isPrimary ? 1 : null,
);

require('./lib/server.js')();
1 change: 1 addition & 0 deletions lib/utapi/utapi.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const _config = require('../Config').config;
const { utapiVersion, UtapiServer: utapiServer } = require('utapi');

Expand Down
1 change: 1 addition & 0 deletions lib/utapi/utapiReindex.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const UtapiReindex = require('utapi').UtapiReindex;
const { config } = require('../Config');

Expand Down
1 change: 1 addition & 0 deletions lib/utapi/utapiReplay.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const UtapiReplay = require('utapi').UtapiReplay;
const _config = require('../Config').config;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"utf8": "~2.1.1",
"uuid": "^3.0.1",
"vaultclient": "scality/vaultclient#7.10.13",
"werelogs": "scality/werelogs#8.1.4",
"werelogs": "scality/werelogs#8.1.5",
"xml2js": "~0.4.16"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5618,6 +5618,13 @@ werelogs@scality/werelogs#8.1.4:
fast-safe-stringify "^2.1.1"
safe-json-stringify "^1.2.0"

werelogs@scality/werelogs#8.1.5:
version "8.1.5"
resolved "https://codeload.github.com/scality/werelogs/tar.gz/4131abec824a336eeb68b531e6c91f2748a0644a"
dependencies:
fast-safe-stringify "^2.1.1"
safe-json-stringify "^1.2.0"

werelogs@scality/werelogs#GA7.2.0.5:
version "7.2.0"
resolved "https://codeload.github.com/scality/werelogs/tar.gz/bc034589ebf7810d6e6d61932f94327976de6eef"
Expand Down

0 comments on commit 7305b11

Please sign in to comment.