{"id":24199274,"url":"https://github.com/simp-lee/asynclog","last_synced_at":"2026-06-11T07:31:44.281Z","repository":{"id":218342243,"uuid":"746180433","full_name":"simp-lee/AsyncLog","owner":"simp-lee","description":"A Minimal, Colorful, and Asynchronous Logging Library for Go, with File Output Capabilities.","archived":false,"fork":false,"pushed_at":"2024-07-07T06:33:40.000Z","size":1357,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T09:26:39.971Z","etag":null,"topics":["async","golang","logger","logging"],"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/simp-lee.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":"2024-01-21T10:05:35.000Z","updated_at":"2024-07-07T06:33:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"a129a166-689c-4cac-8ae6-baabeab2274c","html_url":"https://github.com/simp-lee/AsyncLog","commit_stats":null,"previous_names":["simp-lee/asynclog"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/simp-lee/AsyncLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp-lee%2FAsyncLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp-lee%2FAsyncLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp-lee%2FAsyncLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp-lee%2FAsyncLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simp-lee","download_url":"https://codeload.github.com/simp-lee/AsyncLog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp-lee%2FAsyncLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["async","golang","logger","logging"],"created_at":"2025-01-13T20:35:17.728Z","updated_at":"2026-06-11T07:31:44.242Z","avatar_url":"https://github.com/simp-lee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AsyncLog: An Asynchronous Logging Package for Go\n\n**Status: Deprecated**\n\nThis package was initially created as a personal learning project to explore Go's logging capabilities. It has served its purpose in providing hands-on experience with logging in Go. However, it is now deprecated and should not be used in production environments.\n\nFor production-grade logging solutions, it is highly recommended to use the official Go `slog` package along with the third-party package `github.com/lmittmann/tint`. Package `tint` implements a zero-dependency `slog.Handler` that writes tinted (colorized) logs. Its output format is inspired by the `zerolog.ConsoleWriter` and `slog.TextHandler`.\n\n`AsyncLog` is a versatile and efficient asynchronous logging library for Go, designed for multi-level logging with support for custom formatting, colored output, and file logging capabilities.\n\n## Features\n\n- **Asynchronous Logging:** Processes log messages in a separate goroutine for minimal impact on main application flow.\n- **Multiple Log Levels:** Supports levels like Trace, Debug, Info, Warning, Error, and Fatal for detailed logging.\n- **Customizable Output:** Route log messages to different files or the console.\n- **Colored console output:** Enhances readability with color-coded logs in the console.\n- **Source Code Information:** Option to include source file and line number in logs.\n- **Flexible Configuration:** Tailor logger behavior with functional options.\n- **Parameter Formatting:** Choose between JSON or Key-Value formatting for log parameters.\n- **File Logging:** Direct logs to files with configurable file names and output settings.\n\n## Installation\n\nInstall AsyncLog using `go get`:\n\n```bash\ngo get github.com/simp-lee/asynclog\n```\n\n## Quick Start\n\nHere's a basic example to get started with `asynclog`:\n\n```go\npackage main\n\nimport (\n    \"github.com/simp-lee/asynclog\"\n    \"time\"\n)\n\nfunc main() {\n    // Create a new logger\n    logger, err := asynclog.NewLogger()\n    if err != nil {\n        panic(err)\n    }\n    defer logger.Close() // Ensure logger is closed at the end\n\t\n    // Logging at different levels\n    logger.Trace(\"This is a trace message\")\n    logger.Debug(\"Debugging information here\")\n    logger.Info(\"Informational message\")\n    logger.Warning(\"This is a warning\")\n    logger.Error(\"Encountered an error\")\n    // Use Fatal sparingly - high severity\n    logger.Fatal(\"Fatal error occurred\")\n\t\n    // Wait for a moment to ensure all messages are processed\n    time.Sleep(1 * time.Second)\n}\n```\n\n## Configuration\n\nCustomize the logger at instantiation with various options:\n\n```go\nlogger, err := asynclog.NewLogger(\n    asynclog.SetBufferSize(200),                             // Custom buffer size\n    asynclog.SetFileLevel(asynclog.LogLevelInfo),            // Set file logging level\n    asynclog.SetConsoleLevel(asynclog.LogLevelDebug),        // Set console logging level\n    asynclog.EnableSourceInfo(true),                         // Enable source file information recording\n    asynclog.SetDefaultFileName(\"app.log\"),                  // Set default log file name\n    asynclog.EnableFileOutput(false),                        // Disable file output\n    asynclog.EnableConsoleOutput(true),                      // Enable console output\n    asynclog.SetParamFormatter(asynclog.FormatParamsAsJSON), // Log parameter formatting\n    asynclog.SetMaxFileHandles(20),                          // Set maximum number of file handles\n)\n```\n\n## Parameters and Formatting\n\nInclude additional parameters in your log messages and customize their formatting style:\n\n```go\nparams := map[string]interface{}{\n    \"user_id\": 123,\n    \"action\": \"login\",\n}\nlogger.Info(\"User action\", asynclog.SetLogParams(params)) // Log with additional parameters\n```\n\n## Contributing\n\nYour contributions to `AsyncLog` are welcome! Feel free to open issues or submit pull requests for improvements or new features.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimp-lee%2Fasynclog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimp-lee%2Fasynclog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimp-lee%2Fasynclog/lists"}