$ npm install logs-console --saveJust include in your project
import LogsConsole from "logs-console";create a init config
| Var Environment | Description |
|---|---|
| APPLICATION_ID | Id application at the server |
| AUTHENTICATION | Authentication is a base64 CLIENT_ID:CLIENT_SECRET server generate |
| URL_SERVER | URL of server to write logs. |
| ENVIRONMENT | Enviroment can be DEVELOPMENT, PRODUCTION, STAGGING. |
| ENABLE_RESPONSE | Enable to show at console response server. |
LogsConsole.init(
APPLICATION_ID,
AUTHENTCATION,
URL_SERVER,
ENVIRONMENT,
ENABLE_RESPONSE
);| Option | Description |
|---|---|
| TYPE_ERROR | can be Success, Error, Warning, etc |
| CONTENT_ERROR | Content of error. |
LogsConsole.console(CONTENT_ERROR, TYPE_ERROR);or, if you need just show in terminal a console, you can import log property, follow an example below:
const { log } = require("logs-console");
log.success("This is a success message");
log.error("This is an error message");
log.warning("This is an warning message");
log.info("This is an info message");