Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telemetry Package

Package for telemetry/logging

Features

  • Multiple logging levels (Debug, Info, Warning, Error)
  • Configurable logging backends (drivers)
  • Transaction support for tracking related log entries
  • JSON configuration
  • Thread safe

Basic Usage

There is an example in cmd/main.go

Configuration

Configuration is done through the config.json like:

{
  "driver": "console",
  "driver_config": "logs.txt",
  "log_level": 1,
  "default_tags": {
    "environment": "development",
    "go_version": "1.22",
    "app_version": "1.0.0"
  }
}

Extending the Package

You can write your own driver by putting it into the drivers folder, and specifing it in the config.json. There are multiple drivers already, which can be used as an example or starting point.

Possible improvements

  • Using a buffer for logging
  • More sophisticated error handling
  • Log rotation configuration
  • Clean up transaction code
  • Write some more tests

License

Use it as you wish

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages