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
- Host: GitHub
- URL: https://github.com/anmiles/logger
- Owner: anmiles
- License: mit
- Created: 2024-01-30T20:09:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-24T06:15:16.000Z (11 months ago)
- Last Synced: 2025-07-24T07:52:37.517Z (11 months ago)
- Topics: console, debug, javascript, jest, library, logging, nodejs, typescript
- Language: TypeScript
- Size: 2.3 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
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');
```