1.0.5 • Published 12 months ago
easelog v1.0.5
EaseLog
Installation
Recommended (for Typescript projects)
npx easelog initThe easelog init cli command downloads just the logger.ts and types.ts file. The best part about this is it allows you to make the project yours, you can adjust the logger the way you feel appropriate. If you do end up doing something you feel would help others, consider contributing!
Conventional (for Javascript projects)
npm i easelogUsage
With file save
import { Logger } from "easelog"
const path = "" // where the log file is created
const log = new Logger(path)
log.info("Message", "Location")Without file save
This is just unnecessary abstraction, but I did use chalk.js for colouring the logs to spice things up though
import { Logger } from "easelog" const log = new Logger() log.info("Message") log.warn("Message") log.error("Message", "Location") log.debug("Message", "Location")
Note: location is optional
Types
Logger(path:string|undefined)path is optional.
saveToFile(message: string, type:logType, location: string | undefined, path: string | undefined)location and path are optional.
EaseLog CLI
Usage: easelog [options] [command]
Options:
-V,--versionoutput the version number-h,--helpdisplay help for command
Commands:
init [destination]clone logger.ts in your project; default destination is the current working directoryhelp [command]display help for command
More info
EaseLog does not support commonjs