@seasonjs/log
v0.0.3
Published
Js log library which copy from vscode
Downloads
2
Maintainers
Readme
@seasonjs/log
Js log library which copy from vscode
quick start
install
npm
npm i @seasonjs/log
yarn
yarn add @seasonjs/log
pnpm
pnpm add @seasonjs/log
example usage
just console log
import {LogService, ConsoleLogger} from '@seasonjs/log'
const logger = new LogService(new ConsoleLogger(LogLevel.Debug))
logger.info("this is an info")
use with node and write to file
import path from "node:path"
import {LogService, ConsoleLogger, DEFAULT_LOG_LEVEL, URI, BufferLogger} from '@seasonjs/log'
import {LoggerService} from '@seasonjs/log/node'
const uri = URI.file(path.join(__dirname, './.test_data/log'))
const loggerService = new LoggerService(DEFAULT_LOG_LEVEL, uri)
const bufferLogger = new BufferLogger(loggerService.getLogLevel());
const logger = new LogService(new ConsoleLogger(loggerService.getLogLevel()), [bufferLogger])
logger.info("this is an info")