Skip to content

Log flush interrupted before completed #55

@ImAl3x03

Description

@ImAl3x03

Versions

  • Logger Version: v1.8.0
  • Node Version: v20.11.0
  • Operating System: Windows 11
  • Terminal: Windows Powershell

Expected Behavior

const clientId = process.env.BOT_CLIENT_ID;
const token = process.env.BOT_TOKEN;

if(!clientId || !token) {
    log.error("Missing bot configuration")
    process.exit(1)
}

The log must be flushed to file (option write is set to true) before the process exit

Actual Behavior

The process.exit() function stop the program before the log library finish to flush the log to file

Steps to Reproduce

Execute the code in the previously snippet without settings the env variable

Fix

The problem is fixed by making the fse.appenFile() sync changing it to fse.appendFileSync()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions