Skip to content

Commit

Permalink
chore: 🔊 updated logging as cli.log has been deprecated for plugins i…
Browse files Browse the repository at this point in the history
  • Loading branch information
KillDozerX2 committed Apr 1, 2022
1 parent 9c5f51f commit 79d1df4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const convertAwsLocalCrontabToAwsUtcCrontab = (localCrontab, timezone) => {
* @param {ServerlessLocalCrontabs} this
*/
function convertCrontabs(this) {
this.log.info("Converting local crontabs to UTC crontabs...")
const newCrontabsMap = {};
for (const funcName in this.serverless.service.functions) {
for (const eventIndex in this.serverless.service.functions[funcName]
Expand Down Expand Up @@ -158,6 +159,29 @@ class ServerlessLocalCrontabs {
*/
constructor(serverless, options, { log }) {
this.serverless = serverless;
if (log) {
this.log = log
}
else if (serverless.cli.log) {
this.log = {
/**
* @param {String} message
*/
info: (message) => {
serverless.cli.log(message)
}
}
}
else {
this.log = {
/**
* @param {String} message
*/
info: (message) => {
console.log(message)
}
}
}
if (
this.serverless.configSchemaHandler &&
this.serverless.configSchemaHandler.defineFunctionEventProperties
Expand Down

0 comments on commit 79d1df4

Please sign in to comment.