From d2b5f21e9db2f2e74d4dcf6137db2d4cfd57ee1d Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Wed, 31 Jul 2024 04:30:34 -0400 Subject: [PATCH] feat(pockethost): gobot verbosity --- packages/pockethost/src/services/GobotService.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/pockethost/src/services/GobotService.ts b/packages/pockethost/src/services/GobotService.ts index 85a5ec0d..777342ea 100644 --- a/packages/pockethost/src/services/GobotService.ts +++ b/packages/pockethost/src/services/GobotService.ts @@ -1,10 +1,19 @@ +import { default as env } from 'env-var' import { GobotOptions, gobot } from 'gobot' import { mkSingleton } from '../common' import { PH_GOBOT_ROOT } from '../constants' +export const PH_GOBOT_VERBOSITY = () => + env.get(`PH_GOBOT_VERBOSITY`).default(1).asIntPositive() + export const GobotService = mkSingleton(() => { return { - gobot: (name: string, options?: Partial) => - gobot(name, { ...options, cachePath: PH_GOBOT_ROOT(`cache`, name) }), + gobot: (name: string, options?: Partial) => { + // verbosity(PH_GOBOT_VERBOSITY()) + return gobot(name, { + ...options, + cachePath: PH_GOBOT_ROOT(`cache`, name), + }) + }, } })