@@ -37,23 +37,22 @@ module.exports.process = async function upsertObject(message, configuration) {
37
37
const { sobject } = configuration ;
38
38
if ( message . body . Id ) {
39
39
configuration . lookupField = 'Id' ;
40
- this . logger . info ( 'Upserting sobject=%s by internalId' , sobject ) ;
41
- this . logger . trace ( 'Upserting sobject=%s by internalId=%s, data: %j ' , sobject , message . body . Id , message ) ;
40
+ this . logger . debug ( 'Upserting sobject=%s by internalId' , sobject ) ;
41
+ this . logger . trace ( 'Upserting sobject=%s by internalId=%s' , sobject , message . body . Id ) ;
42
42
await callJSForceMethod . call ( this , configuration , 'sobjectUpdate' , message ) ;
43
43
} else {
44
44
if ( ! configuration . extIdField ) {
45
45
throw Error ( 'Can not find internalId/externalId ids' ) ;
46
46
}
47
47
configuration . lookupField = configuration . extIdField ;
48
- this . logger . info ( 'Upserting sobject=%s by externalId' , sobject ) ;
49
- this . logger . trace ( 'Upserting sobject=%s by externalId=%s, data: %j ' , sobject , configuration . extIdField , message ) ;
48
+ this . logger . debug ( 'Upserting sobject=%s by externalId' , sobject ) ;
49
+ this . logger . trace ( 'Upserting sobject=%s by externalId=%s' , sobject , configuration . extIdField ) ;
50
50
await callJSForceMethod . call ( this , configuration , 'sobjectUpsert' , message ) ;
51
51
}
52
52
53
53
const lookupResults = await callJSForceMethod . call ( this , configuration , 'sobjectLookup' , message ) ;
54
54
if ( lookupResults . length === 1 ) {
55
- this . logger . info ( 'sobject=%s was successfully upserted by %s' , sobject , configuration . lookupField ) ;
56
- this . logger . trace ( 'sobject=%s was successfully upserted by %s=%s' , sobject , configuration . lookupField , message . body [ configuration . lookupField ] ) ;
55
+ this . logger . debug ( 'sobject=%s was successfully upserted by %s' , sobject , configuration . lookupField ) ;
57
56
await this . emit ( 'data' , messages . newMessageWithBody ( lookupResults [ 0 ] ) ) ;
58
57
return ;
59
58
}
0 commit comments