@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 -vTable 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-librariesTo install and set up the library, run:
$ npm installUsage
To work on this library you have to stay in its package, so you can run the follow command:
$ cd packages/logsServing the app
$ npm startRunning the tests
$ npm testBuilding a distribution version
$ npm run buildThis 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago