Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACRFD-19-2: Minor additional logging tweaks. #206

Merged
merged 1 commit into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions api/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,12 @@ exports.loginWebADE = function() {
}
},
function(err, res, body) {
if (err || (res && res.statusCode !== 200)) {
if (err) {
defaultLog.error('WebADE Login Error:', err);
reject(err);
} else if (res && res.statusCode !== 200) {
defaultLog.info('WebADE Login ResponseCode:', res.statusCode);
reject({ code: (res && res.statusCode) || null });
} else {
try {
var obj = JSON.parse(body);
Expand All @@ -198,7 +202,7 @@ exports.loginWebADE = function() {
reject();
}
} catch (e) {
defaultLog.error('loginWebADE Error:', e);
defaultLog.error('WebADE Login Error:', e);
reject(e);
}
}
Expand Down
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const winston = require('winston');
const defaultLog = winston.loggers.add('default', {
transports: [
new winston.transports.Console({
level: 'silly',
formatter: info => {
return `${moment().format('DD-MM-YYYY HH:mm:ss')} ${info.level}: ${info.message}`;
}
Expand Down
2 changes: 1 addition & 1 deletion openshift/templates/build-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"from": {
"kind": "ImageStreamTag",
"namespace": "${S2I_NAMESPACE}",
"name": "nodejs:6"
"name": "nodejs:10"
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions seed/shapesMigration/updateShapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* i. Updates the ACRFD application features and meta to match whatever is in Tantalis (the source of truth).
*/

// winston logger needs to be created before any local classes (that use the logger) are loaded.
// winston logger needs to be created before any local classes that use the logger are loaded.
const winston = require('winston');
const defaultLog = winston.loggers.add('default', {
transports: [new winston.transports.Console()]
transports: [
new winston.transports.Console({
level: 'silly'
})
]
});

var Promise = require('es6-promise').Promise;
Expand Down