diff --git a/packages/backend-core/src/logging/index.ts b/packages/backend-core/src/logging/index.ts index 276a8d627c..b229f47dea 100644 --- a/packages/backend-core/src/logging/index.ts +++ b/packages/backend-core/src/logging/index.ts @@ -1,5 +1,5 @@ export * as correlation from "./correlation/correlation" -export { default as logger } from "./pino/logger" +export { logger, disableLogger } from "./pino/logger" export * from "./alerts" // turn off or on context logging i.e. tenantId, appId etc diff --git a/packages/backend-core/src/logging/pino/logger.ts b/packages/backend-core/src/logging/pino/logger.ts index c82876f49a..dd4b505d30 100644 --- a/packages/backend-core/src/logging/pino/logger.ts +++ b/packages/backend-core/src/logging/pino/logger.ts @@ -5,6 +5,17 @@ import * as correlation from "../correlation" import { IdentityType } from "@budibase/types" import { LOG_CONTEXT } from "../index" +// CORE LOGGERS - for disabling + +const BUILT_INS = { + log: console.log, + error: console.error, + info: console.info, + warn: console.warn, + trace: console.trace, + debug: console.debug, +} + // LOGGER const pinoOptions: LoggerOptions = { @@ -31,6 +42,15 @@ if (env.isDev()) { export const logger = pino(pinoOptions) +export function disableLogger() { + console.log = BUILT_INS.log + console.error = BUILT_INS.error + console.info = BUILT_INS.info + console.warn = BUILT_INS.warn + console.trace = BUILT_INS.trace + console.debug = BUILT_INS.debug +} + // CONSOLE OVERRIDES interface MergingObject { @@ -166,5 +186,3 @@ const getIdentity = () => { } return identity } - -export default logger diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 77e4d6da8e..d64f25f497 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,4 +1,6 @@ #!/usr/bin/env node +import { logging } from "@budibase/backend-core" +logging.disableLogger() import "./prebuilds" import "./environment" import { getCommands } from "./options" diff --git a/packages/cli/src/plugins/index.ts b/packages/cli/src/plugins/index.ts index cfafd67720..45e024be7f 100644 --- a/packages/cli/src/plugins/index.ts +++ b/packages/cli/src/plugins/index.ts @@ -54,7 +54,7 @@ async function init(opts: PluginOpts) { if (!type || !PLUGIN_TYPE_ARR.includes(type)) { console.log( error( - "Please provide a type to init, either 'component' or 'datasource'." + "Please provide a type to init, either 'component', 'datasource' or 'automation'." ) ) return diff --git a/packages/server/src/automations/steps/delay.ts b/packages/server/src/automations/steps/delay.ts index 9eeebb1667..9cf578805c 100644 --- a/packages/server/src/automations/steps/delay.ts +++ b/packages/server/src/automations/steps/delay.ts @@ -1,8 +1,9 @@ import { wait } from "../../utilities" import { AutomationActionStepId, - AutomationStepSchema, + AutomationIOType, AutomationStepInput, + AutomationStepSchema, AutomationStepType, } from "@budibase/types" @@ -18,7 +19,7 @@ export const definition: AutomationStepSchema = { inputs: { properties: { time: { - type: "number", + type: AutomationIOType.NUMBER, title: "Delay in milliseconds", }, }, @@ -27,7 +28,7 @@ export const definition: AutomationStepSchema = { outputs: { properties: { success: { - type: "boolean", + type: AutomationIOType.BOOLEAN, description: "Whether the delay was successful", }, }, diff --git a/packages/server/src/automations/steps/executeScript.ts b/packages/server/src/automations/steps/executeScript.ts index ac43deb5ac..9bd0eaed18 100644 --- a/packages/server/src/automations/steps/executeScript.ts +++ b/packages/server/src/automations/steps/executeScript.ts @@ -41,8 +41,8 @@ export const definition: AutomationStepSchema = { description: "Whether the action was successful", }, }, + required: ["success"], }, - required: ["success"], }, }