https://github.com/coder/ts-logger
https://github.com/coder/ts-logger
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/coder/ts-logger
- Owner: coder
- Created: 2019-07-31T19:03:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-01T12:50:45.000Z (about 1 year ago)
- Last Synced: 2025-04-02T22:35:30.984Z (23 days ago)
- Language: TypeScript
- Size: 533 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Logger
Beautiful logging inspired by https://github.com/uber-go/zap.
- Built for node and the browser
- Zero dependencies
- Uses groups in the browser to reduce clutter## Example Usage
```javascript
import { field, logger } from "@coder/logger";logger.info("Loading container",
field("container_id", container.id_str),
field("organization_id", organization.id_str));
```## Formatting
By default the logger uses a different formatter depending on whether it detects
it is running in the browser or not. A custom formatter can be set:```javascript
import { logger, Formatter } from "@coder/logger";class MyFormatter extends Formatter {
// implementation ...
}logger.formatter = new MyFormatter();
```