2.0.7 • Published 4 months ago

logbotjs v2.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

LogBot

LogBot is a simple logger written in TypeScript. It works in both Node.js and bun.

Installation

Use your favourite package manager to install LogBot.

npm install logbotjs

Usage

import { LogBot } from "logbotjs"

const logger = new LogBot({
    logfile: "./log.txt",
})

//alternatively
logger.setLogFilePath("./log.txt")

logger.log(404, "Not found")
logger.log(100, "Continue")
logger.log(200, "OK")
logger.log(500, "Internal server error")

Will print to console:

example.png

And will write to log.txt:

[2021-08-01 12:00:00] [404] Not found
[2021-08-01 12:00:01] [404] Continue
[2021-08-01 12:00:02] [200] OK
[2021-08-01 12:00:03] [500] Internal server error

Widgets

Spinner

logger.widgets.spinner.start('spinner1', 'Loading...')
logger.widgets.spinner.update('spinner1', 'Loading... 50%')
logger.widgets.spinner.end('spinner1')

Progressbar

logger.widgets.progress.start('progress1', 'Downloading...', 100)
logger.widgets.progress.update('progress1', 50)
logger.widgets.progress.increment('progress1', 50)
logger.widgets.progress.end('progress1')
2.0.3

4 months ago

2.0.2

4 months ago

2.0.5

4 months ago

2.0.4

4 months ago

2.0.7

4 months ago

2.0.6

4 months ago

2.0.1

4 months ago

2.0.0

4 months ago

1.2.0

2 years ago

1.1.6

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago