logger/test/otherProcess.js
2023-06-15 13:13:46 +03:00

27 lines
734 B
JavaScript

// const { LoggerClient } = require('../');
import { LoggerClient } from '../build/esm/index.js';
const logger = new LoggerClient({
customTypes: [ 'access' ],
customStreams: [ 'access' ],
customTypeMapping: { access: 'access', warn: 'error' },
customColours: { access: 'green' },
logLevelMapping: { access: 2 }
});
const main = async () =>
{
for (let i = 0; i < 5; i++)
{
// if (i % 500 === 0)
await new Promise(resolve => setTimeout(resolve, 1000));
logger.info('Info test');
logger.status('Status test');
logger.debug('Debug test');
logger.warn('Warn test');
logger.error('Error test');
logger.access('Access test');
}
};
main();