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

Bugfix/1043 log files include custom color codes #1044

Merged
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
28 changes: 22 additions & 6 deletions lib/metadataTypes/Automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,19 @@ class Automation extends MetadataType {
}));
found++;
} else {
throw new TypeError(JSON.stringify(notificationsResult));
if (
!notificationsResult ||
typeof notificationsResult !== 'object' ||
Object.keys(notificationsResult).length !== 1 ||
!notificationsResult?.programId
) {
throw new TypeError(JSON.stringify(notificationsResult));
}
// * if there are no automation notifications, the API returns a single object with the programId
}
} catch (ex) {
Util.logger.debug(
` ☇ skipping Notifications for Automation ${automationLegacy.key}: ${ex.message} ${ex.code}`
` ☇ issue retrieving Notifications for automation ${automationLegacy.key}: ${ex.message} ${ex.code}`
);
skipped++;
}
Expand Down Expand Up @@ -397,14 +405,22 @@ class Automation extends MetadataType {
activity.activityObjectId == null
) {
Util.logger.debug(
` - skip parsing of activity due to missing activityObjectId: ${JSON.stringify(
activity
)}`
` - skipping ${
metadata[this.definition.keyField]
} activity ${stepNumber}.${
activity.displayOrder
} due to missing activityObjectId: ${JSON.stringify(activity)}`
);
// empty if block
} else if (!this.definition.dependencies.includes(activity.r__type)) {
Util.logger.debug(
` - skip parsing because the type is not set up as a dependecy for ${this.definition.type}`
` - skipping ${
metadata[this.definition.keyField]
} activity ${stepNumber}.${
activity.displayOrder
} because the type ${
activity.r__type
} is not set up as a dependency for ${this.definition.type}`
);
}
// / if managed by cache we can update references to support deployment
Expand Down
2 changes: 2 additions & 0 deletions lib/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const Util = {
filename: 'logs/' + logFileName + '.log',
level: 'debug', // log everything
format: winston.format.combine(
winston.format.uncolorize(),
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
winston.format.simple(),
winston.format.printf(
Expand All @@ -278,6 +279,7 @@ const Util = {
filename: 'logs/' + logFileName + '-errors.log',
level: 'error', // only log errors
format: winston.format.combine(
winston.format.uncolorize(),
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
winston.format.simple(),
winston.format.printf(
Expand Down