https://github.com/ialopezg/custom-logger-service
Custom Logger for Apps and API's
https://github.com/ialopezg/custom-logger-service
console debug error info log logger logging warn
Last synced: 2 months ago
JSON representation
Custom Logger for Apps and API's
- Host: GitHub
- URL: https://github.com/ialopezg/custom-logger-service
- Owner: ialopezg
- License: mit
- Created: 2020-04-29T04:09:08.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T19:49:16.000Z (over 3 years ago)
- Last Synced: 2025-01-20T01:31:55.261Z (over 1 year ago)
- Topics: console, debug, error, info, log, logger, logging, warn
- Language: TypeScript
- Size: 376 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Custom Logger Service
Custom tools for NodeJS
> Custom Logger for Apps and API Services
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[](https://coveralls.io/github/ialopezg/custom-logger-service?branch=main)
## Description
CUstomLoggerService is an utility service that helps you to display debugging, error, informative, log, and warning messages. This tool is made to be used in [Node.js](https://nodejs.org), which allows you to easily build efficient,
scalable applications. It uses modern JavaScript, is built with [TypeScript](https://typescriptlang.org) and
bring best JavaScript concepts.
## Technology Stack







## Features
- Compatible with both TypeScript and ES6 (I recommend to use [TypeScript](http://www.typescriptlang.org))
## Getting started
### Requirements
- [NodeJS](https://nodejs.org/) v8+
- [NPM](https://www.npmjs.com/package/npm) v6+ or [yarn](https://yarnpkg.com/) v1.17+
- [custom-console-colors](https://www.npmjs.com/package/custom-console-colors)
### Installation
You have two options to install this repository.
1. By adding the dependency to your `package.json` file.
```json
{
"dependencies": {
"custom-logger-service": "^0.2.2"
}
}
```
```bash
# Install dependencies
# NPM
npm install
# or Yarn
yarn
```
2. By using a package manager
```bash
# NPM
npm install --save custom-console-color
# or Yarn
yarn add @ialopezg/core
```
### Usage
#### Initialization
__Default options__
```javascript
const { LoggerService } = require('custom-logger-service')
// With default options
const logger = new Logger();
```
__No options nor styles__
```javascript
const logger = new Logger({
useFormat: false,
});
```
__No options and default format__
```javascript
const config: FormatOptions = {
useFormat: true,
useAppName: false,
usePID: false,
useContext: false,
useEvent: false,
useTimestamp: false,
usePadding: false,
};
const logger = new LoggerService(config);
```
### Usage
```javascript
const message = 'Hello World!';
logger.debug(message);
logger.error(message);
logger.info(message);
logger.log(message);
logger.warn(message);
```
### Examples
- [Server-Side Rendering](./exampes)
## Available Colors and Styles
| Event | Color |
| ----- | ------- |
| debug | grey |
| error | red |
| info | blue |
| log | green |
| warn | yellow |
## People
Author - [Isidro A. Lopez G.](https://github.com/ialopezg")
## License
CustomLoggerService is under [MIT](LICENSE) license.
---
© Copyright 2019-present - CustomLoggerService by [Isidro A. López G.](https://ialopezg.com/)
[npm-image]: https://img.shields.io/npm/v/custom-logger-service.svg
[npm-url]: https://npmjs.org/package/custom-logger-service
[downloads-image]: https://img.shields.io/npm/dm/custom-logger-service.svg
[downloads-url]: https://www.npmjs.com/package/custom-logger-service
[travis-image]: https://img.shields.io/travis/ialopezg/custom-logger-service/main.svg
[travis-url]: https://travis-ci.org/ialopezg/custom-logger-service
[coveralls-image]: https://img.shields.io/coveralls/ialopezg/custom-logger-service.svg?style=flat
[coveralls-url]: https://coveralls.io/r/ialopezg/custom-logger-service?branch=main