{"id":25170190,"url":"https://github.com/gosuit/sl","last_synced_at":"2025-06-28T01:02:39.697Z","repository":{"id":274941500,"uuid":"924548249","full_name":"gosuit/sl","owner":"gosuit","description":"Laconic and flexible logging library","archived":false,"fork":false,"pushed_at":"2025-03-30T10:15:07.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T10:27:40.352Z","etag":null,"topics":["golang","logging","slog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gosuit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-30T08:04:37.000Z","updated_at":"2025-03-30T09:40:22.000Z","dependencies_parsed_at":"2025-03-10T19:29:35.411Z","dependency_job_id":"56abec52-374d-4a9c-8aea-0ae2162dfdc7","html_url":"https://github.com/gosuit/sl","commit_stats":null,"previous_names":["gosuit/sl"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gosuit/sl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuit%2Fsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuit%2Fsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuit%2Fsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuit%2Fsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gosuit","download_url":"https://codeload.github.com/gosuit/sl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuit%2Fsl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357505,"owners_count":23298457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","logging","slog"],"created_at":"2025-02-09T08:39:10.057Z","updated_at":"2025-06-28T01:02:39.668Z","avatar_url":"https://github.com/gosuit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SL\n\nSL Logger is a lightweight logging library built on top of Go's log/slog package. It provides a flexible and configurable logging interface that allows developers to easily integrate logging into their applications. With support for different log levels, output formats, and handlers, SL Logger is designed to fit a variety of use cases.\n\n## Installation\n\n```zsh\ngo get github.com/gosuit/sl\n```\n\n## Features\n\n• Configurable Logging Levels: Set the logging level to control the verbosity of the logs (e.g., debug, info, warn, error).\n\n• Multiple Output Options: Log to standard output, files, or discard logs entirely.\n\n• Structured Logging: Supports structured logging with attributes for better log analysis.\n\n• Contextual Logging: The logger can be placed and removed from the context to transfer the logger to different parts of the application.\n\n• Custom Handlers: Easily switch between different logging handlers (e.g., dev, pretty, discard, default).\n\n## Usage\n\n### Configuration\n\nYou can configure the logger using the Config struct. Here’s an example configuration:\n\n```golang\ncfg := \u0026sl.Config{\n    Level:     \"info\",\n    AddSource: true,\n    Writer:    \"stderr\",\n    Type:      \"default\",\n}\n```\n\n### Creating a Logger\n\n```golang\nlogger := sl.New(cfg)\n```\n\n### Logging Messages\n\n```golang\nlogger.Debug(\"Debug message\", \"key\", \"value\")\nlogger.Info(\"Info message\", \"key\", \"value\")\nlogger.Warn(\"Warning message\", \"key\", \"value\")\nlogger.Error(\"Error message\", \"key\", \"value\")\nlogger.Fatal(\"Fatal message\", \"key\", \"value\")\n```\n\n### Context\n\n```golang\nctx := context.Background()\nctx = sl.ContextWithLogger(logger)\n\nl := sl.L(ctx)\n\nl.Info(\"Info message\", \"key\", \"value\")\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosuit%2Fsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgosuit%2Fsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosuit%2Fsl/lists"}