File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 2
2
const co = require ( 'co' ) ;
3
3
const amqp = require ( 'amqplib' ) ;
4
4
const encryptor = require ( '../encryptor.js' ) ;
5
+ const debug = require ( 'debug' ) ( 'publish' ) ;
5
6
6
7
let channel ;
7
8
@@ -14,15 +15,15 @@ module.exports.init = init;
14
15
* @param cfg
15
16
*/
16
17
function init ( cfg ) {
17
- console . log ( 'Starting initialization, cfg=%j' , cfg ) ;
18
+ console . log ( 'Starting initialization' ) ;
18
19
const amqpURI = cfg . amqpURI ;
19
20
const amqpExchange = cfg . topic ;
20
21
return co ( function * gen ( ) {
21
- console . log ( 'Connecting to amqpURI=%s' , amqpURI ) ;
22
+ debug ( 'Connecting to amqpURI=%s' , amqpURI ) ;
22
23
const conn = yield amqp . connect ( amqpURI ) ;
23
- console . log ( 'Creating a confirm channel' ) ;
24
+ debug ( 'Creating a confirm channel' ) ;
24
25
channel = yield conn . createConfirmChannel ( ) ;
25
- console . log ( 'Asserting topic exchange exchange=%s' , amqpExchange ) ;
26
+ debug ( 'Asserting topic exchange exchange=%s' , amqpExchange ) ;
26
27
yield channel . assertExchange ( amqpExchange , 'topic' ) ;
27
28
} ) ;
28
29
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ let listening;
15
15
* @param cfg
16
16
*/
17
17
function init ( cfg ) {
18
- console . log ( 'Starting initialization, cfg=%j queueName=%s' , cfg , queueName ) ;
18
+ console . log ( 'Starting initialization, queueName=%s' , queueName ) ;
19
19
const amqpURI = cfg . amqpURI ;
20
20
const amqpExchange = cfg . topic ;
21
21
const keys = ( cfg . bindingKeys || '#' ) . split ( ',' ) . map ( ( s ) => s . trim ( ) ) ;
@@ -51,7 +51,7 @@ function init(cfg) {
51
51
* @param cfg configuration that is account information and configuration field values
52
52
*/
53
53
function processAction ( msg , cfg ) {
54
- console . log ( 'Trigger started, cfg=%j' , cfg ) ;
54
+ console . log ( 'Trigger started' ) ;
55
55
if ( listening ) {
56
56
console . log ( 'Trigger was called again, we will ignore this run' ) ;
57
57
return Promise . resolve ( ) ;
You can’t perform that action at this time.
0 commit comments