spawn ve tail ile loglari izleme ve pretty etmek
programming, typescript, spawn ve tail ile loglari izleme ve pretty etmek, loglari izleme, pretty etmek, spawn, pino-pretty, tail
function tailLogs({ filepath, level, region }) {
const tailCommand = `tail -f ${filepath}`
const prettyCommand = `node_modules/.bin/pino-pretty -I level,name,time -L ${level}`
const command = !region
? `${tailCommand} | ${prettyCommand}`
: `ssh ${region} '${tailCommand}' | ${prettyCommand}`
console.log(`Running: ${command}`)
spawn(command, { stdio: "inherit", shell: true }).on("error", error => {
console.error(`Error: ${error.message}`)
})
}PreviousSafe Pushing with Git: -force-if-includesNextssh ile sunucudaki GUI uygulamalarini (chromium gibi) macOS uzerinde calistirmak
Last updated
Was this helpful?