Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
fix: Package rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyzwezdin committed Feb 23, 2024
1 parent 1b283fe commit f8746f5
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 275 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# @sergeyzwezdin/node-logger
# @relab/node-logger

Winston-based logger configuration with Telegram integration.

![node-logger](./docs/demo.png)

## Usage

1. `npm install --save @sergeyzwezdin/node-logger`
1. `npm install --save @relab/node-logger`
2. Configure layout, verbosity level and Telegram (if necessary)
3. Patch `console` object:
```typescript
import { patchCommonLogger } from '@sergeyzwezdin/node-logger'
import { patchCommonLogger } from '@relab/node-logger'
patchCommonLogger()
```
4. Import `logger` to write logs into default area
Expand All @@ -20,20 +20,20 @@ patchCommonLogger()

### Layout
```typescript
import { configureLogger } from '@sergeyzwezdin/node-logger'
import { configureLogger } from '@relab/node-logger'
configureLogger({ kind: 'layout', layout: ['timestamp', 'level', 'area', 'message', 'details', 'error'] })
```

### Verbosity level
```typescript
import { configureLogger } from '@sergeyzwezdin/node-logger'
import { configureLogger } from '@relab/node-logger'
configureLogger({ kind: 'verbosity', verbosity: { area: '*', level: 'error' } })
configureLogger({ kind: 'verbosity', verbosity: { area: 'express', level: 'debug' } })
```

### Telegram
```typescript
import { configureLogger } from '@sergeyzwezdin/node-logger'
import { configureLogger } from '@relab/node-logger'
configureLogger({
kind: 'telegram',
telegram: {
Expand All @@ -46,7 +46,7 @@ configureLogger({

## Example of usage
```typescript
import { patchCommonLogger, logger, scoped, configureLogger } from '@sergeyzwezdin/node-logger'
import { patchCommonLogger, logger, scoped, configureLogger } from '@relab/node-logger'

// Configure and patch logger
configureLogger({ kind: 'layout', layout: ['timestamp', 'level', 'area', 'message', 'details', 'error'] })
Expand Down
Loading

0 comments on commit f8746f5

Please sign in to comment.