🌳
pt0/deployF/k8sF/logsF/watchFlogsF.mts
1import * as _ from 'lodash-es'
3import { streamPodLogs } from './podLogsF.mts'
7// Skip streaming if in programmatic test context, opencode, multi-deploy sequence, or running under ptnode (already logging to file)
8export const shouldSkipStreamLogs = () => quietModeCtx.getStore()?.quiet || isOpenCode || multiDeployCtx.getStore()?.skipStreamLogs || process.env.PTNODE_LOG_PATH
10type WatchFlogsProps = {
11 doWatch?: boolean
12 name?: string
13 action?: string
16export const watchFlogs = async (props1?: WatchFlogsProps) => {
17 const {doWatch=true, ...props} = props1 || {}
18 const {name, action, cluster_name} = _.merge(getKlusterCtx(), props) as {name: string, action: string, cluster_name: string}
20 if (!_.includes(['logs', 'apply'], action)) return
22 if (shouldSkipStreamLogs()) return
24 await streamPodLogs({name, cluster_name})