Skip to content

Commit b4368a4

Browse files
committed
improve server logs:
- stringify browserify error objects before logging them - don't log 'Bundle updated' if bundle error
1 parent aee5afa commit b4368a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

devtools/test_dashboard/server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,23 @@ function writeFilePromise(path, contents) {
134134
function bundlePlotly() {
135135
b.bundle(function(err) {
136136
if(err) {
137-
console.error('Error while bundling!', err);
137+
console.error('Error while bundling!', JSON.stringify(String(err)));
138+
} else {
139+
console.log('Bundle updated at ' + new Date().toLocaleTimeString());
138140
}
139141

140142
if(firstBundle) {
141143
open('http://localhost:' + PORT + '/devtools/test_dashboard');
142144
firstBundle = false;
143145
}
144-
console.log('Bundle updated at ' + new Date().toLocaleTimeString());
145146
}).pipe(fs.createWriteStream(constants.pathToPlotlyBuild));
146147
}
147148

148149
function bundleDevtools() {
149150
return new Promise(function(resolve, reject) {
150151
devtools.bundle(function(err) {
151152
if(err) {
152-
console.error('Error while bundling!', err);
153+
console.error('Error while bundling!', JSON.stringify(String(err)));
153154
return reject(err);
154155
} else {
155156
return resolve();

0 commit comments

Comments
 (0)