Skip to content

Commit a80943f

Browse files
committed
Added integration tests, reduced sensitive logging
1 parent 3bff39b commit a80943f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/actions/publish.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const co = require('co');
33
const amqp = require('amqplib');
44
const encryptor = require('../encryptor.js');
5+
const debug = require('debug')('publish');
56

67
let channel;
78

@@ -14,15 +15,15 @@ module.exports.init = init;
1415
* @param cfg
1516
*/
1617
function init(cfg) {
17-
console.log('Starting initialization, cfg=%j', cfg);
18+
console.log('Starting initialization');
1819
const amqpURI = cfg.amqpURI;
1920
const amqpExchange = cfg.topic;
2021
return co(function* gen() {
21-
console.log('Connecting to amqpURI=%s', amqpURI);
22+
debug('Connecting to amqpURI=%s', amqpURI);
2223
const conn = yield amqp.connect(amqpURI);
23-
console.log('Creating a confirm channel');
24+
debug('Creating a confirm channel');
2425
channel = yield conn.createConfirmChannel();
25-
console.log('Asserting topic exchange exchange=%s', amqpExchange);
26+
debug('Asserting topic exchange exchange=%s', amqpExchange);
2627
yield channel.assertExchange(amqpExchange, 'topic');
2728
});
2829
}

lib/triggers/consume.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let listening;
1515
* @param cfg
1616
*/
1717
function init(cfg) {
18-
console.log('Starting initialization, cfg=%j queueName=%s', cfg, queueName);
18+
console.log('Starting initialization, queueName=%s', queueName);
1919
const amqpURI = cfg.amqpURI;
2020
const amqpExchange = cfg.topic;
2121
const keys = (cfg.bindingKeys || '#').split(',').map((s) => s.trim());
@@ -51,7 +51,7 @@ function init(cfg) {
5151
* @param cfg configuration that is account information and configuration field values
5252
*/
5353
function processAction(msg, cfg) {
54-
console.log('Trigger started, cfg=%j', cfg);
54+
console.log('Trigger started');
5555
if (listening) {
5656
console.log('Trigger was called again, we will ignore this run');
5757
return Promise.resolve();

0 commit comments

Comments
 (0)