Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aerogo/log
:memo: Logging with multiple output targets.
https://github.com/aerogo/log
go log logging
Last synced: about 2 months ago
JSON representation
:memo: Logging with multiple output targets.
- Host: GitHub
- URL: https://github.com/aerogo/log
- Owner: aerogo
- License: mit
- Created: 2017-06-10T09:54:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-26T04:19:45.000Z (about 5 years ago)
- Last Synced: 2024-04-14T04:05:05.092Z (8 months ago)
- Topics: go, log, logging
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - log - An O(1) logging system that allows you to connect one log to multiple writers (e.g. stdout, a file and a TCP connection). (Logging / Search and Analytic Databases)
- awesome-go-extra - log - 06-10T09:54:08Z|2019-10-26T04:19:45Z| (Logging / Advanced Console UIs)
README
# log
[![Godoc][godoc-image]][godoc-url]
[![Report][report-image]][report-url]
[![Tests][tests-image]][tests-url]
[![Coverage][coverage-image]][coverage-url]
[![Sponsor][sponsor-image]][sponsor-url]An O(1) constant time logging system that allows you to connect one log to multiple writers (e.g. stdout, a file and a TCP connection).
## Installation
```shell
go get -u github.com/aerogo/log/...
```## Example
```go
hello := log.New() // Create a new log
hello.AddWriter(log.File("hello.log")) // Add a writerhello.Info("Hello World %d %d %d", 1, 2, 3) // Write non-critical data (buffered)
hello.Error("Something went wrong") // Force an immediate I/O flush for error messages
```## Under the hood
All `Write` calls are queued into a channel that is read in a separate goroutine. Once the channel receives new data it writes the data to all registered outputs.
## Style
Please take a look at the [style guidelines](https://github.com/akyoto/quality/blob/master/STYLE.md) if you'd like to make a pull request.
## Sponsors
| [![Cedric Fung](https://avatars3.githubusercontent.com/u/2269238?s=70&v=4)](https://github.com/cedricfung) | [![Scott Rayapoullé](https://avatars3.githubusercontent.com/u/11772084?s=70&v=4)](https://github.com/soulcramer) | [![Eduard Urbach](https://avatars3.githubusercontent.com/u/438936?s=70&v=4)](https://twitter.com/eduardurbach) |
| --- | --- | --- |
| [Cedric Fung](https://github.com/cedricfung) | [Scott Rayapoullé](https://github.com/soulcramer) | [Eduard Urbach](https://eduardurbach.com) |Want to see [your own name here?](https://github.com/users/akyoto/sponsorship)
[godoc-image]: https://godoc.org/github.com/aerogo/log?status.svg
[godoc-url]: https://godoc.org/github.com/aerogo/log
[report-image]: https://goreportcard.com/badge/github.com/aerogo/log
[report-url]: https://goreportcard.com/report/github.com/aerogo/log
[tests-image]: https://cloud.drone.io/api/badges/aerogo/log/status.svg
[tests-url]: https://cloud.drone.io/aerogo/log
[coverage-image]: https://codecov.io/gh/aerogo/log/graph/badge.svg
[coverage-url]: https://codecov.io/gh/aerogo/log
[sponsor-image]: https://img.shields.io/badge/github-donate-green.svg
[sponsor-url]: https://github.com/users/akyoto/sponsorship