https://github.com/andreas-timm/logger-ts
Small Bun-first logging utilities built on top of winston
https://github.com/andreas-timm/logger-ts
bun logger logging typescript winston
Last synced: 22 days ago
JSON representation
Small Bun-first logging utilities built on top of winston
- Host: GitHub
- URL: https://github.com/andreas-timm/logger-ts
- Owner: andreas-timm
- License: bsd-3-clause
- Created: 2026-04-28T14:15:50.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-01T07:00:25.000Z (about 2 months ago)
- Last Synced: 2026-05-01T08:30:41.680Z (about 2 months ago)
- Topics: bun, logger, logging, typescript, winston
- Language: TypeScript
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @andreas-timm/logger
Small Bun-first logging utilities built on top of `winston`.
## Features
- Create a configured `winston` logger with console output.
- Add a synchronous file transport by passing an output path.
- Truncate an output file on logger creation with `flag: "w"`.
- Prefix debug messages consistently while keeping the API small.
## Install
```sh
bun add @andreas-timm/logger
```
## Usage
```ts
import { getLogger } from "@andreas-timm/logger";
const logger = getLogger();
logger.info("Application started");
logger.error("File not found");
```
To write log lines to a file as well as the console:
```ts
import { getLogger } from "@andreas-timm/logger";
const logger = getLogger({
flag: "w",
output: "tmp/app.log",
});
logger.info("Written to console and file");
```
Pass `file: false` to keep the same options object shape while disabling file output.