Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3ff9568

Browse files
committed
More debug logging
1 parent 38fdc28 commit 3ff9568

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utils/EventDetector.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
const Joi = require('joi');
1313
const _ = require('lodash');
14+
const logger = require('../utils/logger');
1415

1516
class EventDetector {
1617

@@ -35,12 +36,14 @@ class EventDetector {
3536
_.forEach(this.events, (e) => {
3637
let result = Joi.validate(data, e.schema, {stripUnknown: true});
3738
if (result.error) {
39+
logger.info(`Joi validate: ${JSON.stringify(result.error)}`);
3840
return;
3941
}
4042
const obj = e.parse(data);
4143
// validate
4244
result = Joi.attempt(obj, e.event.schema);
4345
if (result.error) {
46+
logger.info(`Joi schema attempt error: ${JSON.stringify(result.error)}`);
4447
throw result.error;
4548
}
4649
// done

0 commit comments

Comments
 (0)