@premmia/logs v1.0.20
Logs library for Premmia backend's projects
This library have to be used in backend projects to write logs in cloud watch using the same log library (winston). It is going to standardize all project logs.
Prerequisites
This project requires NodeJS (version 14 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
Table of contents
Installation
BEFORE YOU INSTALL: please read the prerequisites
Start with cloning this repo on your local machine:
$ git clone https://github.com/mesainc/vibra-libraries
$ cd vibra-libraries
To install and set up the library, run:
$ npm install
Usage
To work on this library you have to stay in its package, so you can run the follow command:
$ cd packages/logs
Serving the app
$ npm start
Running the tests
$ npm test
Building a distribution version
$ npm run build
This task will create a distribution version of the project
inside your local dist/
folder
Functions
setting up a context
import { setContext } from '@premmia/logs';
setContext('MY_CONTEXT);
Logging a INFO message
import { logInfo } from '@premmia/logs';
logInfo('some message);
Logging a WARN message
import { logWarn } from '@premmia/logs';
logWarn('some message);
Logging a ERROR message
import { logError } from '@premmia/logs';
logError('some message);
Logging a DEBUG message
import { logDebug } from '@premmia/logs';
logDebug('some message);
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :sunglasses:
Authors
- Tiago Muniz - Github
License
MIT License © Andrea SonnY
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago