Promise’leri calistirmadan tanimlamak icin function () ⇒ {} olarak tanimlanmali
programming, typescript, javascript, promise, async-await, promise, function calling
async function prettifyLogs({ exchange, logFile }) {
const outdir = `./logs/${exchange}/${logFile}`
const infile = `logs/${exchange}/${logFile}.log`
const logLevels = ["debug", "info", "warn", "error"]
mkdirSync(outdir, { recursive: true })
const promises = logLevels.map(async logLevel => {
const outfile = `${outdir}/${logLevel}.log`
const command = `./node_modules/.bin/pino-pretty -i pid,hostname -L ${logLevel} < ${infile} > ${outfile}`
await execPromise(command)
await execPromise(`split -b 12M -d ${outfile} ${outfile}`)
unlinkSync(outfile)
})
await Promise.all(promises)
readdirSync(outdir).forEach(file => {
console.log(`"${outdir}/${file}"`)
})
}Previouspm2, pino ve pino-pretty ile bunjs projesinin raporlarini yonetmekNextPyTest ile Testlerinizi Yönetin: Bağımlılıklar ve Sıralama
Last updated
Was this helpful?