log-likho

1.2.1 • Public • Published

log-likho

Our favourite console.log, but on steroids.

Usage

npm install log-likho

Now at the start of the code let's modify console.log with this steroid version.

console.log = require('log-likho')();

console.log('testing 1');

This should do normal log to console but also write logs real-time to the logs folder

Log in append mode

console.log = require('log-likho')({mode: 'a'});

console.log('testing 1');

With all the options

const create_logger = require('log-likho');

console.log = create_logger({
  logs_folder: './my_folder',
  mode: "a",
})

This will create log files in my_folder and will not delete old log for that day but instead append it with new logs.

Default options

Options Default Value Possible values Purpose
logs_folder './logs' any accessible folder Sets the folder path where the logs will be stored
mode 'w' 'a' or 'w' configures how daily logs are written i.e overwriting mode with 'w' or append mode with 'a'

Package Sidebar

Install

npm i log-likho

Weekly Downloads

7

Version

1.2.1

License

MIT

Unpacked Size

5.71 kB

Total Files

11

Last publish

Collaborators

  • neetishraj