Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
2.0.0 - code refactor, add "transports"
Browse files Browse the repository at this point in the history
  • Loading branch information
TorchedSammy committed Sep 22, 2020
1 parent 7764571 commit 62952c6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# Loggaby
The simple and light logger for Node.js
> 📝 A minimal and simplistic logger with no bloat.
Loggaby aims to be a simple, minimalistic and lightweight logger that doesn't bring useless dependencies and extra unneeded features.
It has 1 goal and strives for it well: Posting nice looking logs to your terminal (or perhaps a custom transport?!? See [the example](#example)for details).

Oh, it looks like this:
![](https://modeus.is-inside.me/V6nRi6i6.png)
## Install
`npm i loggaby`

## Example
```js
const Loggaby = require("loggaby")
const logger = new Loggaby()
const Loggaby = require('loggaby');
const TerminalTransport = new Loggaby.TerminalTransport();
const logger = new Loggaby({
transports: [TerminalTransport] // NOTE: This is provided by default. There is no reason
// to import TerminalTransport unless adding your own extra transports.
// For an implementation example of a Transport, see `lib/transports/TerminalTransport.js`
});

logger.log("Hello World!")
logger.log('Hello World!');
```

#### new Loggaby(options)
The Loggaby constructor, which creates a `logger` instance.
- `options` {Object}
- `logFunction` {Function} The function to use to log. (Default: `console.log`)
- `color` {Boolean} Whether to use ANSI color codes for color. (Default: `true`)
- `transports` {Object[]} (An array of objects or specifically [transport instances](lib/transports/)) What transports to log to. An example is provided above. (Default: `[TerminalTransport]`)
- `debug` {Boolean} Whether to print debug messages. (Default: `true`)

## Levels
Expand Down
16 changes: 11 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
{
"name": "loggaby",
"version": "1.0.1",
"description": "The simple and light logger for Node.js",
"main": "index.js",
"version": "2.0.0",
"description": "📝 A minimal and simplistic logger with no bloat.",
"main": "lib/index.js",
"scripts": {
"test": "node test.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Terminalfreaks/Loggaby.git"
"url": "git+https://github.com/Luvella/Loggaby.git"
},
"keywords": [
"logger",
"log",
"terminal"
],
"author": "Terminalfreaks",
"author": "Luvella",
"license": "MIT",
"bugs": {
"url": "https://github.com/Terminalfreaks/Loggaby/issues"
"url": "https://github.com/Luvella/Loggaby/issues"
},
"homepage": "https://github.com/Terminalfreaks/Loggaby#readme",
"homepage": "https://github.com/Luvella/Loggaby#readme",
"dependencies": {
"ansiplace": "^1.1.0"
"ansikit": "^1.1.4"
},
"devDependencies": {
"@luvella/eslint-config": "^1.0.2"
}
}

0 comments on commit 62952c6

Please # to comment.