.option('-f, --files [file...]', 'Files to parse. If not provided, the script will parse the latest log file from config)')
.parse(process.argv)
+const options = program.opts()
+
const excludedKeys = {
level: true,
message: true,
if (CONFIG.LOG.PRETTIFY_SQL) {
additionalInfos += '\n' + sqlFormat(info.sql, {
language: 'sql',
- ident: ' '
+ indent: ' '
})
} else {
additionalInfos += ' - ' + info.sql
const logger = winston.createLogger({
transports: [
new winston.transports.Console({
- level: program['level'] || 'debug',
+ level: options.level || 'debug',
stderrLevels: [],
format: winston.format.combine(
winston.format.splat(),
.catch(err => console.error(err))
function run () {
- return new Promise(async res => {
+ return new Promise<void>(async res => {
const files = await getFiles()
for (const file of files) {
}
async function getFiles () {
- if (program['files']) return program['files']
+ if (options.files) return options.files
const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR)