https://github.com/point-c/wglog
wglog enhances the functionality of the device.Logger type found in wireguard-go
https://github.com/point-c/wglog
golang golang-library wireguard wireguard-go
Last synced: 29 days ago
JSON representation
wglog enhances the functionality of the device.Logger type found in wireguard-go
- Host: GitHub
- URL: https://github.com/point-c/wglog
- Owner: point-c
- License: mit
- Created: 2023-12-25T05:15:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-08T04:23:41.000Z (over 2 years ago)
- Last Synced: 2025-11-22T19:03:20.519Z (7 months ago)
- Topics: golang, golang-library, wireguard, wireguard-go
- Language: Go
- Homepage: https://point-c.github.io/wglog/
- Size: 348 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wglog
[](https://point-c.github.io/wglog)
[](https://raw.githack.com/wiki/point-c/wglog/coverage.html)
This is a set of extensions for `Wireguard-go`'s logger.
## Installation
To use wglog in your Go project, install it using `go get`:
```bash
go get github.com/point-c/wglog
```
## Loggers
- `noop`: Non-nil logger that does nothing.
- `slog`: Converts a `slog.Logger` to a `device.Logger`.
- Logging is done on the following levels:
- `Verbosef`
- `slog.LevelDebug`
- `Errorf`
- `slog.LevelError`
- `multi`: Emits log messages on multiple loggers.
- `async`: Runs the logger funcs in a goroutine.
## Testing
The package includes tests that demonstrate its functionality. Use Go's testing tools to run the tests:
```bash
go test
```
## Godocs
To regenerate godocs:
```bash
go generate -tags docs ./...
```