Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 months 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-08T04:23:41.000Z (11 months ago)
- Last Synced: 2024-02-08T05:25:01.409Z (11 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
[![Go Reference](https://img.shields.io/badge/godoc-reference-%23007d9c.svg)](https://point-c.github.io/wglog)
[![Go Coverage](https://github.com/point-c/wglog/wiki/coverage.svg)](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 ./...
```