tlc-core-automation-framework-v3-wdio-v9
Version:
Background: - We are following multi-layer automation framework architecture using webdriver.io + cucumber + typescript This core framework has been implemented with generic utility functions and cucumber steps, which can be easily consumed by another fra
30 lines (21 loc) • 677 B
text/typescript
import winston, {level} from "winston";
//format of the logger.info
const consoleFormat = winston.format.printf(({level, message}) => {
const logLevel = winston.format.colorize().colorize(level, `${level.toUpperCase()}`);
return `[${logLevel}] : ${message}`;
})
//Logger
let logger = winston.createLogger({
transports: [
new winston.transports.Console({
level: process.env.LOG_LEVEL,
handleExceptions: true,
format: winston.format.combine(winston.format.timestamp(), consoleFormat)
})
]
})
//print unknown error
logger.on('error', err => {
logger.info(`${err.message}`);
})
export default logger;