{"id":21387177,"url":"https://github.com/sshtools/slf4j-tty","last_synced_at":"2025-03-16T12:17:33.544Z","repository":{"id":238671083,"uuid":"797168562","full_name":"sshtools/slf4j-tty","owner":"sshtools","description":"An SLF4J provider focused on pretty console logging output.","archived":false,"fork":false,"pushed_at":"2024-10-01T11:12:40.000Z","size":424,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T00:13:30.762Z","etag":null,"topics":["ansi","coloured","java","logging","slf4j","tty"],"latest_commit_sha":null,"homepage":"","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/sshtools.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-05-07T10:24:09.000Z","updated_at":"2024-10-01T11:12:44.000Z","dependencies_parsed_at":"2024-05-16T21:31:23.283Z","dependency_job_id":"78fd5984-f223-473f-8b1b-cf65b9625c0c","html_url":"https://github.com/sshtools/slf4j-tty","commit_stats":null,"previous_names":["sshtools/slf4j-tty"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fslf4j-tty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fslf4j-tty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fslf4j-tty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fslf4j-tty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshtools","download_url":"https://codeload.github.com/sshtools/slf4j-tty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864825,"owners_count":20360360,"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","coloured","java","logging","slf4j","tty"],"created_at":"2024-11-22T12:12:03.318Z","updated_at":"2025-03-16T12:17:33.518Z","avatar_url":"https://github.com/sshtools.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SLF4J TTY\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.sshtools/slf4j-tty/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.sshtools/slf4j-tty)\n[![javadoc](https://javadoc.io/badge2/com.sshtools/slf4j-tty/javadoc.svg)](https://javadoc.io/doc/com.sshtools/slf4j-tty)\n![JPMS](https://img.shields.io/badge/JPMS-com.sshtools.slf4jtty-purple) \n\nA colourful logger provider for SLF4J for making your console log output pretty.\n\n*Note this is not intended for logging to a file, although there are options to do so. This provider is focused on console log output'*\n\nRequires any modern terminal that has ANSI color and emoticon support.\n\n![SLF4J-TTY](src/web/screenshot.png)\n\n## Who Is This For?\n\n * You have a console application that uses SL4F4J and you want pretty output\n * You have a console application that pipes logged output to another application and you want to capture simple log output in a consistent manner.\n\n## Features\n\n * Flexible configuration based on INI files.\n * Live configuration changes.\n * Style a log event according to log priority level.\n * Style and decorate any field with color, styles and emoticons.\n * Highlight parameters in parameterized log events.\n * Output resizes automatically with terminal\n * JSON output option\n \n## Usage\n\nSLF4J-TTY is in Maven central, so simply add the dependency to your project. \n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.sshtools\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-tty\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n_See badge above for version available on Maven Central. Snapshot versions are in the [Sonatype OSS Snapshot Repository](https://oss.sonatype.org/content/repositories/snapshots/)._\n \n## Design\n\nSLF4J-TTY kind of steps outside of SLF4Js intended design a bit. Usually, any particular provider would actually be an adapter to a separate (existing) logging framework, for example Log4J.\n\nHowever, given SLF4J has become the de-facto standard, and all the projects I intend to use SLF4J-TTY with use it, I saw little point right now in implementing an entirely new logging framework.\n\nSo instead, SLF4J-TTY is more basically more like `slf4j-simple`, which is the simple provider that implements the SLF4J API directly. The code in fact was based on this provider.\n\n## TODO\n\nThis is the very first alpha release. There are a few bugs, and incompete areas.\n \n * No way to load defaults from classpath resource.\n * Live configuration reloading not implemented. \n\n## Configuration\n\nConfiguration is achieved using INI format files. The library comes with a pre-defined default, which you can override any and all properties using a resource in your project. \n\nFurther configuration may be achieved by the user by creating either a system-wide or user specific file in the usual location for configuration the operating system in use.\n\n### Defaults\n\nThe defaults used are as follows. \n\n```ini\n;\n; Log\n;\n\n[log]\n\tenabled = TRUE\n\tdefault-level = INFO\n\toutput = SYS_ERR\n\tlog-file = \n\t\n[output]\n\tstyle-as-level = TRUE\n\tgap  = 1\n\tellipsis = …\n\twidth = 0\n\tfallback-width = 132\n\tparameter-style = @{bold ${parameter}}\n\tlayout = level, short-name, message, thread-name, date-time \n\t\t\n[fields]\n\t[fields.date-time]\n\t\talignment = RIGHT\n\t\ttype = DATE_TIME\n\t\tformat = SHORT\n\t\twidth = 23\n\t\tstyle = @{faint ${date-time}}\n\t\n\t[fields.level]\n\t\talignment = LEFT\n\t\twidth = 9\n\t\tstyle = [${level}]\n\t\n\t[fields.thread-id]\n\t\talignment = LEFT\n\t\twidth = 10\n\t\tstyle = ${thread-id}\n\t\n\t[fields.thread-name]\n\t\talignment = LEFT\n\t\twidth = 15\n\t\tstyle = [${thread-name}]\n\t\n\t[fields.message]\n\t\talignment = LEFT\n\t\twidth = 0\n\t\tstyle =${message}\n\t\n\t[fields.markers]\n\t\talignment = LEFT\n\t\twidth = 0\n\t\tstyle = ${markers}\n\t\n\t[fields.name]\n\t\talignment = LEFT\n\t\twidth = 0\n\t\tstyle = ${name}\n\t\n\t[fields.short-name]\n\t\talignment = LEFT\n\t\twidth = 15\n\t\tstyle = @{bold ${short-name}}\n\t\t\n\n[levels]\n\tname = Levels\n\tdescription = Configuration for each of the levels\n\t\n\t[levels.TRACE]\n\t\ttext = 🔍 TRACE\n\t\tstyle = @{faint ${text}}\n\t\t\n\t[levels.DEBUG]\n\t\ttext = 🐛 DEBUG\n\t\tstyle = @{italic,fg:cyan ${text}}\n\t\t\n\t[levels.INFO]\n\t\ttext = ℹ️ INFO\n\t\tstyle = @{fg:blue ${text}}\n\t\t\t\n\t[levels.WARN]\n\t\ttext = ⚠️ WARN\n\t\tstyle = @{fg:yellow ${text}}\n\t\t\n\t[levels.ERROR] \n\t\ttext = ⛔ ERROR\n\t\tstyle = @{bold,fg:red ${text}}\n\t\t\n```\n\n### Styles Expressions\n\nSLF4J-TTY uses Jline3's [StyleExpression](https://www.javadoc.io/doc/org.jline/jline/3.23.0/org/jline/style/StyleExpression.html) for it's `style` configuration items. With these, you can style the text for the item using any common support ANSI terminal sequence.\n\n#### Selection Of Styles\n\n * fg\n * bg\n * blink\n * bold\n * conceal\n * crossed-out\n * crossedout\n * faint\n * hidden\n * inverse\n * inverse-neg\n * inverseneg\n * italic\n * underline","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fslf4j-tty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshtools%2Fslf4j-tty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fslf4j-tty/lists"}