{"id":19085585,"url":"https://github.com/theritikchoure/logx","last_synced_at":"2025-11-11T17:30:33.913Z","repository":{"id":199921508,"uuid":"704166412","full_name":"theritikchoure/logx","owner":"theritikchoure","description":"LogX is a Go package that allows you to add color and formatting to your console log messages, making it easier to distinguish different types of log entries or to add emphasis to specific messages. ","archived":false,"fork":false,"pushed_at":"2023-10-29T13:58:50.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T21:47:08.945Z","etag":null,"topics":["ansi","color","coloring","go","go-lang","golang","hacktoberfest","hacktoberfest-accepted","logx"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/theritikchoure/logx","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/theritikchoure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2023-10-12T17:13:36.000Z","updated_at":"2024-03-09T13:55:36.000Z","dependencies_parsed_at":"2023-10-27T11:32:33.710Z","dependency_job_id":"c4110491-1dd3-4fc1-a63d-7edc7caff2ba","html_url":"https://github.com/theritikchoure/logx","commit_stats":null,"previous_names":["theritikchoure/colr"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Flogx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Flogx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Flogx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theritikchoure%2Flogx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theritikchoure","download_url":"https://codeload.github.com/theritikchoure/logx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240136981,"owners_count":19753645,"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":["ansi","color","coloring","go","go-lang","golang","hacktoberfest","hacktoberfest-accepted","logx"],"created_at":"2024-11-09T02:56:39.738Z","updated_at":"2025-11-11T17:30:33.874Z","avatar_url":"https://github.com/theritikchoure.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logx: Colorful Logging for Go\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/theritikchoure/logx)](https://goreportcard.com/report/github.com/theritikchoure/logx)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/theritikchoure/logx/blob/main/LICENSE)\n[![GitHub Release](https://img.shields.io/github/v/release/theritikchoure/logx)](https://github.com/theritikchoure/logx/releases)\n[![Build Status](https://travis-ci.org/theritikchoure/logx.svg?branch=main)](https://github.com/theritikchoure/logx/actions)\n[![GoDoc](https://pkg.go.dev/badge/github.com/theritikchoure/logx)](https://pkg.go.dev/github.com/theritikchoure/logx)\n[![Coverage Status](https://coveralls.io/repos/github/theritikchoure/logx/badge.svg?branch=main)](https://coveralls.io/github/theritikchoure/logx?branch=main)\n\n\n`logx` is a Go package that allows you to add color and formatting to your console log messages, making it easier to distinguish different types of log entries or to add emphasis to specific messages. It provides a simple way to enhance your application's log output.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Enabling or Disabling Color](#enabling-or-disabling-color)\n  - [Log](#log)\n  - [Logf](#logf)\n  - [LogWithLevel](#logwithlevel)\n  - [LogM](#logm)\n  - [LogWithTimestamp](#logwithtimestamp)\n  - [LogToFile](#logtofile)\n- [Guide](#guide)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\nTo use `logx`, you need to import it in your Go code:\n\n```go\nimport \"github.com/theritikchoure/logx\"\n```\n\nThen, install it with `go get`:\n\n```go\ngo get github.com/theritikchoure/logx\n```\n\n## Usage\n\n### Enabling or Disabling Color\nBy default, colorized logging is disabled. You can enable or disable it by modifying the `ColoringEnabled` variable in your code. Setting it to `true` will enable colored output, and setting it to `false` will disable it.\n\n```go\nlogx.ColoringEnabled = true // Enable colorized logging\nlogx.ColoringEnabled = false // Disable colorized logging (default)\n```\n\n### Log\nThe `Log` function allows you to print log messages with specified foreground and background colors. If coloring is disabled, it will print plain text.\n\n```go\nlogx.Log(\"This is a log message\", logx.FGRED, logx.BGGREEN)\n```\n\n### Logf\nUse `Logf` to format log messages and specify colors. It is similar to `fmt.Printf`.\n\n```go\nlogx.Logf(\"User: %s logged in.\", logx.FGBLUE, logx.BGWHITE, \"JohnDoe\")\n```\n\n### LogWithLevel\n`LogWithLevel` is helpful for displaying log messages with predefined background colors corresponding to log levels such as INFO, WARNING, ERROR, and SUCCESS.\n\n```go\nlogx.LogWithLevel(\"An error occurred\", \"ERROR\")\n```\n\n### LogM\nWith `LogM`, you can log multiple messages with customized formatting options.\n\n```go\nlogx.LogM([]string{\"Applying\", \"updates...\"}, logx.FGBLUE, logx.BGYELLOW, logx.BOLD, logx.UNDERLINE)\n```\n\n### LogWithTimestamp\n`LogWithTimestamp` adds a timestamp to your log message. It's particularly useful for recording when an event occurred.\n```go\nlogx.LogWithTimestamp(\"System restarted\", logx.FGCYAN, logx.BGWHITE)\n```\n\n### LogToFile\n`LogToFile` logs messages to a file in addition to standard output.\n\n```go\nlogx.LogToFile(\"Log entry written to file\", logx.FGRED, logx.BGGREEN, \"log.txt\")\n```\n\n## Guide\n\n- [LogX — Enhance Your GoLang Projects with Colorful Logging](https://ritikchourasiya.medium.com/logx-enhance-your-golang-projects-with-colorful-logging-1f93df825cd8)\n\n## Contributing\nWe welcome contributions from the community! If you'd like to contribute to logx, follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes and add tests if applicable.\n4. Run tests and ensure they pass.\n5. Submit a pull request with a clear description of your changes.\n\nWe appreciate your help in improving logx.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/theritikchoure/logx/blob/main/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheritikchoure%2Flogx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheritikchoure%2Flogx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheritikchoure%2Flogx/lists"}