Skip to content

jkaninda/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LOGGER

Tests Go Report Card Go Go Reference GitHub Release

Logger provides a configurable logging solution with multiple output options, log levels, and rotation capabilities built on top of Go's slog package.

Installation

go get github.com/jkaninda/logger

Usage Example

l := logger.New(
WithOutputFile("/var/log/app.log"),
WithCaller(),
WithInfoLevel(),
WithMaxAge(1),
WithMaxSize(100),
WithJSONFormat(),
)
l.Info("Application started", "version", "1.0.0")

Default config

	l := logger.Default()
	l.Info("Application started", "version", "1.0.0", "config", "default")

Using global logger instance

	logger.New(logger.WithJSONFormat())

	logger.Info("Application started", "version", "1.0.0")

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to your fork
  5. Open a Pull Request

Give a Star! ⭐

⭐ If you find Okapi useful, please consider giving it a star on GitHub!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Copyright

Copyright (c) 2025 Jonas Kaninda

About

Logger is a configurable logging solution with multiple output options, log levels, and rotation capabilities built on top of Go's slog package.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages