Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deptno/filename-logger
extend `debug`, `dir/filename.js: ...logs`
https://github.com/deptno/filename-logger
debug filename log logger ndoejs node node-debug node-log node-logger
Last synced: about 9 hours ago
JSON representation
extend `debug`, `dir/filename.js: ...logs`
- Host: GitHub
- URL: https://github.com/deptno/filename-logger
- Owner: deptno
- License: mit
- Created: 2018-10-28T07:58:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-28T09:13:31.000Z (about 6 years ago)
- Last Synced: 2024-11-08T10:05:04.805Z (about 2 months ago)
- Topics: debug, filename, log, logger, ndoejs, node, node-debug, node-log, node-logger
- Language: TypeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# filename-logger
[debug](https://github.com/visionmedia/debug) wrapper. logging by filename.
```bash
dynalee:operator/operator.js get undefined +0ms
dynalee:model/model.js { id: 'hello2', detail: 'world' } +0ms
dynalee:model/model.js Error: Item not found, hash(hello2, range(world)
```## Install
```bash
npm i filename-logger
```## Usage
```typescript
import createLogger from 'filename-logger'const PROJECT_NAME = 'project'
const log = createLogger(PROJECT_NAME, __filename)log('something')
```or
```typescript
const PROJECT_NAME = 'project'
const createProjectLogger = createLogger(PROJECT_NAME)const log = createProjectLogger(__filename)
log('something')
```## License
MIT