https://github.com/serokell/co-log-sys
Syslog implementation on top of co-log-core
https://github.com/serokell/co-log-sys
haskell haskell-library logging logging-library syslog
Last synced: about 1 year ago
JSON representation
Syslog implementation on top of co-log-core
- Host: GitHub
- URL: https://github.com/serokell/co-log-sys
- Owner: serokell
- License: mpl-2.0
- Created: 2018-11-07T10:39:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-29T11:04:42.000Z (over 5 years ago)
- Last Synced: 2025-04-07T11:51:34.022Z (about 1 year ago)
- Topics: haskell, haskell-library, logging, logging-library, syslog
- Language: Haskell
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 35
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# co-log-sys
This is a logging library based on [`co-log-core`](https://github.com/kowainik/co-log/tree/master/co-log-core)
that implements a syslog backend.
For more info about how [`co-log`](https://github.com/kowainik/co-log/tree/master/co-log)
works we advise you to read [its presentation blogpost](https://kowainik.github.io/posts/2018-09-25-co-log).
NOTE: It's somewhat opinionated in that:
- it uses the `fmt` library for formatting
- uses `universum` as a `Prelude` alternative
## Example of usage [↑](#co-log-sys)
This is a simple example using the `withLogMessageSyslog` function:
```haskell
example :: IO ()
example = withLogMessageSyslog basicSyslogConfig $ \logMessageSyslog -> do
let logMessageStdout = cmap fmtMessageFlat logTextStdout
logAction = logMessageSyslog <> logMessageStdout
unLogAction logAction $ Message Emergency "NOTICE ME HERE"
where
basicSyslogConfig = SyslogConfig
{ collector = AutoLocal
, facility = User
, appName = "example"
}
```
## Contributions [↑](#co-log-sys)
If you'd like to contribute or file a Bug Report, please read our [Contributors Guide](docs/CONTRIBUTING.md).
## License [↑](#co-log-sys)
[MPL 2.0](LICENSE.md)
## About Serokell [↑](#co-log-sys)
`co-log-sys` is maintained and funded with :heart: by [Serokell](https://serokell.io/). The names and logo for Serokell are trademark of Serokell OÜ.
We love open source software! See [our other projects](https://serokell.io/community?utm_source=github) or [hire us](https://serokell.io/hire-us?utm_source=github) to design, develop and grow your idea!