An open API service indexing awesome lists of open source software.

https://github.com/anmiles/logger

Logging data with timestamp into console and/or file
https://github.com/anmiles/logger

console debug javascript jest library logging nodejs typescript

Last synced: 3 months ago
JSON representation

Logging data with timestamp into console and/or file

Awesome Lists containing this project

README

          

# @anmiles/logger

Logging data with timestamp into console and/or file

----

## Installation

`npm install @anmiles/logger`

## Usage

### Logging to screen and file system

```js
import { Logger } from '@anmiles/logger';

const logger = new Logger({ root: '/log/app', groupByDate: true, showDebug: true });
logger.error('Error message with stack trace');
```

### Logging to screen only

```js
import { error } from '@anmiles/logger';

error('Error message with stack trace');
```

### Using default import to access to multiple log methods

```js
import logger from '@anmiles/logger';

logger.info('Info message');
logger.error('Error message with stack trace');
```