snapshot of https://github.com/ueberdosis/hocuspocus.git @ cf3cfa355b4d3bb61c6b6c80071f71783e32470e (2026-09-15)
Some checks failed
build / lint (22) (push) Failing after 17s
build / test (22) (push) Failing after 8s
build / lint (23) (push) Failing after 2s
build / build (22) (push) Has been skipped
build / build (23) (push) Has been skipped
build / test (23) (push) Failing after 4s
docsearch / docsearch (push) Failing after 1s
Some checks failed
build / lint (22) (push) Failing after 17s
build / test (22) (push) Failing after 8s
build / lint (23) (push) Failing after 2s
build / build (22) (push) Has been skipped
build / build (23) (push) Has been skipped
build / test (23) (push) Failing after 4s
docsearch / docsearch (push) Failing after 1s
This commit is contained in:
56
packages/extension-logger/README.md
Normal file
56
packages/extension-logger/README.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# @hocuspocus/extension-logger
|
||||
[](https://www.npmjs.com/package/@hocuspocus/extension-logger)
|
||||
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
||||
[](https://www.npmjs.com/package/@hocuspocus/extension-logger)
|
||||
[](https://github.com/sponsors/ueberdosis)
|
||||
|
||||
Logs connection, document, and lifecycle events for a [Hocuspocus](https://github.com/ueberdosis/hocuspocus) server to the console. Useful during development and debugging to see when clients connect, documents load and store, and changes come in.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @hocuspocus/extension-logger
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { Server } from "@hocuspocus/server"
|
||||
import { Logger } from "@hocuspocus/extension-logger"
|
||||
|
||||
const server = new Server({
|
||||
extensions: [new Logger()],
|
||||
})
|
||||
|
||||
server.listen()
|
||||
```
|
||||
|
||||
### Silence specific hooks
|
||||
|
||||
Pass booleans per hook to quiet down the ones you don't care about:
|
||||
|
||||
```js
|
||||
new Logger({
|
||||
onConnect: false,
|
||||
onDisconnect: false,
|
||||
onChange: false,
|
||||
})
|
||||
```
|
||||
|
||||
### Use a custom log function
|
||||
|
||||
Route output to your own logger (pino, winston, structured JSON, etc.):
|
||||
|
||||
```js
|
||||
new Logger({
|
||||
log: (...args) => myLogger.info({ msg: args.join(" ") }),
|
||||
})
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Full options reference: [tiptap.dev/docs/hocuspocus/server/extensions/logger](https://tiptap.dev/docs/hocuspocus/server/extensions/logger).
|
||||
|
||||
## License
|
||||
|
||||
MIT — see [LICENSE.md](https://github.com/ueberdosis/hocuspocus/blob/main/LICENSE.md).
|
||||
Reference in New Issue
Block a user