Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mightyhorst/superlogs
https://github.com/mightyhorst/superlogs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mightyhorst/superlogs
- Owner: mightyhorst
- Created: 2021-05-27T01:09:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-22T01:57:19.000Z (over 3 years ago)
- Last Synced: 2024-10-15T04:33:20.776Z (3 months ago)
- Language: JavaScript
- Size: 87.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 🦄 SuperLogs
Super simple logs.Super logs uses the builder pattern to not just build logs but also build a relationship tree between runtime code
### Install
yarn
```
yarn add -D superlogs
```or for npm
```
npm i --dev superlogs
```### Require
For CommonJs
```js
const superlogs = require('superlogs');
const logger = superlogs.logger;
```For Babel
```js
import {logger} from 'superlogs';
```For Typescript
```typescript
import {logger} from 'superlogs';
```
### Usage
An example```js
logger('PlaybookService')
.addMethod('list', 'list a playbook')
.addStep('validate', 'validate the DTO')
.addData('user', {username: 'mitchell'})
.addMongo('playbooks', {id: 100, name: 'airbnb'})
.addStep('if user', 'if no user exists', StepCat.ifBlock)
.addError('no user found', {message: 'not found'})
.addThrows('NoUserFoundError', {message: 'not found'})
.addStep('createdb', 'create the DB')
.addStep('updatedb', 'update the DB')
.addMethod('get', 'get a playbook')
.addStep('validate', 'validate the DTO')
.addStep('createdb', 'create the DB')
.addStep('updatedb', 'update the DB')
.addMethod('create', 'create a playbook')
.addStep('validate', 'validate the DTO')
.addStep('createdb', 'create the DB')
.addStep('updatedb', 'update the DB')
.addMethod('create', 'create a playbook')
.addStep('validate', 'validate the DTO')
.addStep('createdb', 'create the DB')
.addStep('updatedb', 'update the DB')
.addMethod('create', 'create a playbook')
.addMethod('create', 'create a playbook')
.addMethod('create', 'create a playbook')
.addMethod('create', 'create a playbook')
```## API
@todo - write this## Authour/Author
Nick Mitchell - @todo