@fusedb/logger
v0.0.1
Published
A FUSE middleware to handle logging.
Maintainers
Readme
🧩 FUSE Middleware: Logger
A FUSE middleware that provides logging with support for Winston, Pino, etc.
📦 Installation
npm install @fusedb/core
npm install @fusedb/logger🚀 Usage
Console:
const FUSE = require("@fusedb/core");
const JSONDriver = require("@fusedb/json");
const Logger = require("@fusedb/logger");
const db = new FUSE({
driver: new JSONDriver({ path: "./data/db.json" }),
middleware: [new Logger()],
});
(async () => {
await db.set("name", "Fuse");
await db.get("name");
})();Winston:
const FUSE = require("@fusedb/core");
const JSONDriver = require("@fusedb/json");
const Logger = require("@fusedb/logger");
const winston = require("winston");
const customLogger = winston.createLogger({
level: "info",
transports: [new winston.transports.Console()],
});
const db = new FUSE({
driver: new JSONDriver({ path: "./data/db.json" }),
middleware: [
new Logger({ mode: "custom", logger: customLogger })
],
});
(async () => {
await db.set("name", "Fuse");
await db.get("name");
})();⚙️ Options
| Option | Type | Description |
| ------ | ----- | --------------------------------------------- |
| mode | string | Set to custom or console |
| logger | object | Logger instance (e.g. winston or pino) |
| includeValues | object | Log full values |
✅ Features
- ✅ Works with any FUSE driver
- ✅ Compatible with Winston, Pino, etc.
📚 Related
🤝 Contributing
Want to make your own middleware?
- Name it like:
fusedb-<name>or@your-org/fusedb-<name> - Follow the Middleware Guidelines
Feel free to share your plugin with the community!
🧾 License
Licensed under the Apache-2.0.
