{"id":36619331,"url":"https://github.com/luiinge/slf4j-ansi","last_synced_at":"2026-01-12T09:17:42.766Z","repository":{"id":56598032,"uuid":"271838132","full_name":"luiinge/slf4j-ansi","owner":"luiinge","description":"ANSI-formatted messages using SLF4J","archived":false,"fork":false,"pushed_at":"2020-12-19T17:53:47.000Z","size":424,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T12:57:18.436Z","etag":null,"topics":["ansi","logging","slf4j"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/luiinge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-12T16:02:35.000Z","updated_at":"2025-04-05T01:47:18.000Z","dependencies_parsed_at":"2022-08-15T21:40:30.566Z","dependency_job_id":null,"html_url":"https://github.com/luiinge/slf4j-ansi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/luiinge/slf4j-ansi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiinge%2Fslf4j-ansi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiinge%2Fslf4j-ansi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiinge%2Fslf4j-ansi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiinge%2Fslf4j-ansi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luiinge","download_url":"https://codeload.github.com/luiinge/slf4j-ansi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luiinge%2Fslf4j-ansi/sbom","scorecard":{"id":603388,"data":{"date":"2025-08-11","repo":{"name":"github.com/luiinge/slf4j-ansi","commit":"70058e2bc5107cdfd05669043be80f7d3036fee6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/luiinge/slf4j-ansi/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/luiinge/slf4j-ansi/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/luiinge/slf4j-ansi/test.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T00:59:02.865Z","repository_id":56598032,"created_at":"2025-08-21T00:59:02.865Z","updated_at":"2025-08-21T00:59:02.865Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ansi","logging","slf4j"],"created_at":"2026-01-12T09:17:41.733Z","updated_at":"2026-01-12T09:17:42.759Z","avatar_url":"https://github.com/luiinge.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nSLF4J Ansi\n================================================================================\n![GitHub](https://img.shields.io/github/license/luiinge/slf4j-ansi?style=plastic)\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/luiinge/slf4j-ansi/Test/master?style=plastic)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.luiinge/slf4j-ansi?style=plastic)\n\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=luiinge_slf4j-ansi\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=luiinge_slf4j-ansi)\n\n\nThis tool enhances the [*Simple Logging Facade for Java*][1] library with the capability of\nformatting parameters using [ANSI escape codes][2], which are defined as *styles* using\nthe [Jansi][3] library. In addition, overall styles can be defined for each logging level (`ERROR`,\n`WARN`,`INFO`,`DEBUG`, `TRACE`).\n\nIf your console or log storing system does not work nicely with ANSI escape codes, you can\nsimply disable this feature and your messages will be logged without them, while you are not\nrequired to change your code.\n\n\n\nUsage\n-----------------------------------------------------------------------------------------\n### Maven coordinates\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.luiinge\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-ansi\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Quick start\nJust create an `AnsiLogger` wrapper around your Slf4J logger:\n\n```java\nLogger logger = AnsiLogger.of(LoggerFactory.getLogger(YourClass.class);\n```\n\nAfter that, when you want to embed a parameter in a message, you can indicate the style inside the\nbrackets:\n\n```java\nlogger.info(\"The service endpoint is {uri}\", \"http://myserver:8080/service\");\nlogger.warn(\"A timeout of {} seconds has ocurred requesting the resource {resource}\", 4, \"data.json\");\n```\n\n### Defining custom styles\n\nIf you want to add/replace styles, you should configure `AnsiLogger` in some initializing method of your application, so that the styles are applied from the very beginning:\n\n```java\npublic static void someInitializerMethod() {\n  Properties customStyles = new Properties();\n  customStyles.put(\"resource\",\"magenta,underline,bold\");\n  ...\n  AnsiLogger.setStyles(customStyles);\n}\n```\n\n### Overall styles\nApart from the style of each argument of the message, you can define an overall style applied to the whole message, using the syntax `{!style}` at the beggining:\n\n```java\nlogger.info(\"{!important} This is an important message\");\n```\n\nEach log level defined in the SLF4J API use an overall style identified respectively by `error`, `warn`, `info`, `debug`, and `trace`. You can overwrite these styles, and even use them with another log level:\n\n```java\nlogger.debug(\"{!warn} This is a debug message formatted using the style of warn messages\");\n```\n\n### Enable / disable ANSI codes\n\nIt is possible to manually enable / disable the formatting:\n\n```java\nAnsiLogger.setEnabled(false);\n```\n\nWhen disabled, no Ansi codes are generated whatsoever. It is useful if you want to activate/deactivate\nthis feature according to some argument or configuration provided externally.\n\n\n\nDefault styles\n-----------------------------------------------------------------------------------------\nThe built-in styles provided by default are the following:\n\n| Style | Definition |\n| --- | --- |\n|`error`|`red,bold` |\n|`warn`|`yellow,bold` |\n|`trace`|`faint` |\n|`uri`|`blue,underline` |\n|`id`|`cyan,bold` |\n|`important`|`magenta,bold` |\n|`highlight`|`white,bold` |\n\n\n\nJansi Codes\n-----------------------------------------------------------------------------------------\nThe recognized styles are defined by Jansi codes (can be combined with commas), which are:\n\n| Code | Representation |\n| --- | --- |\n| `black` | black text color |\n| `red` | red text color |\n| `green` | green text color |\n| `yellow` | yellow text color |\n| `blue` | blue text color |\n| `magenta` | magenta text color |\n| `cyan` | cyan text color |\n| `white` | white text color |\n| `bold` | bold text intensity |\n| `faint` | faint text intensity |\n| `underline` | underline text |\n| `blink_slow` | text blinking at low rate |\n| `blink_fast` | text blinking at high rate |\n| `bg_black` | black background color |\n| `bg_red` | red background color |\n| `bg_green` | green background color |\n| `bg_yellow` | yellow background color |\n| `bg_blue` | blue text background |\n| `bg_magenta` | magenta background color |\n| `bg_cyan` | cyan background color |\n| `bg_white` | white background color |\n\n\n\nOther considerations\n-----------------------------------------------------------------------------------------\n\nBe aware that the use of this library will add extra computational cost to your underlying logging\nsystem. For this reason, it is not recommended in scenarios where performance may be an issue, for\nexample extensive logging during long operations. Also, logging to targets other than console\nwill produce the same ANSI codes. Thus, it might difficult the readability of the messages if the\nvisualizer tool used does not support ANSI.\n\n\n\nAuthors\n-----------------------------------------------------------------------------------------\n\n- Luis Iñesta Gelabert  |  luiinge@gmail.com\n\n\nContributions\n-----------------------------------------------------------------------------------------\nIf you want to contribute to this project, visit the\n[Github project](https://github.com/luiinge/slf4j-ansi). You can open a new issue / feature\nrequest, or make a pull request to consider. You will be added\nas a contributor in this very page.\n\nIssue reporting\n-----------------------------------------------------------------------------------------\nIf you have found any defect in this software, please report it \nin [Github project Issues](https://github.com/luiinge/slf4j-ansi/issues). \nThere is no guarantee that it would be fixed in the following version but it would \nbe addressed as soon as possible.   \n \n  \n\nLicense\n-----------------------------------------------------------------------------------------\n\n```\nMIT License\n\nCopyright (c) 2020 Luis Iñesta Gelabert\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n```\n\n\n[1]: https://www.slf4j.org\n[2]: https://en.wikipedia.org/wiki/ANSI_escape_code\n[3]: https://fusesource.github.io/jansi/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluiinge%2Fslf4j-ansi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluiinge%2Fslf4j-ansi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluiinge%2Fslf4j-ansi/lists"}