https://github.com/gosuit/c
Extended Context
https://github.com/gosuit/c
context golang logging
Last synced: 10 months ago
JSON representation
Extended Context
- Host: GitHub
- URL: https://github.com/gosuit/c
- Owner: gosuit
- License: mit
- Created: 2025-01-30T15:46:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-24T19:50:39.000Z (10 months ago)
- Last Synced: 2025-08-25T11:52:45.420Z (10 months ago)
- Topics: context, golang, logging
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C
C is a Go library that provides a context management system with advanced functionality.
## Installation
```zsh
go get github.com/gosuit/c
```
## Features
- Logging using the sl.Logger.
- Storage of key-value pairs with ability to log values.
- Implementation of context.Context.
## Usage
```golang
package main
import (
"github.com/gosuit/c"
"github.com/gosuit/sl"
)
func main() {
ctx := c.New(sl.Default())
ctx.AddValue("key1", "value1", false)
ctx.AddValue("key2", "value2", true)
some(ctx)
}
func some(ctx c.Context) {
log := ctx.Logger()
log.Info("msg") // result has attribute key2=value2
}
```
## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.