Skip to content

gosuit/c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C

C is a Go library that provides a context management system with advanced functionality.

Installation

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

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 file for details.

About

Extended Context

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages