{"id":16964986,"url":"https://github.com/propensive/eucalyptus","last_synced_at":"2025-08-25T15:17:53.869Z","repository":{"id":37235483,"uuid":"139843409","full_name":"propensive/eucalyptus","owner":"propensive","description":"Versatile logging with static configuration for Scala","archived":false,"fork":false,"pushed_at":"2025-02-06T07:15:33.000Z","size":2832,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-19T18:21:57.960Z","etag":null,"topics":["logging","logs","scala"],"latest_commit_sha":null,"homepage":"https://soundness.dev/eucalyptus/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"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":"2018-07-05T12:02:39.000Z","updated_at":"2025-02-06T07:15:37.000Z","dependencies_parsed_at":"2023-02-14T18:16:03.033Z","dependency_job_id":"f9a981e2-2d74-4f2e-84b5-45acafe5d03d","html_url":"https://github.com/propensive/eucalyptus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/propensive/eucalyptus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Feucalyptus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Feucalyptus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Feucalyptus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Feucalyptus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/eucalyptus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Feucalyptus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272085244,"owners_count":24870675,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["logging","logs","scala"],"created_at":"2024-10-13T23:44:46.629Z","updated_at":"2025-08-25T15:17:53.804Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/eucalyptus/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/eucalyptus/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Eucalyptus\n\n__Versatile logging__\n\n_Eucalyptus_ is a logging library which makes it easy to add logging to any project. It consciously\nmakes logging configuration explicit and easily understood, and uses rich ANSI-escaped messages to\nmake logs easier to read.\n\n## Features\n\n- logging requires explicit configuration in code, avoiding any doubt about whether or where logs are produced\n- logging \"realms\" are defined as givens\n- logging configuration may be static or delegate to dynamic criteria\n- unlogged messages are not evaluated, avoiding the cost of construction\n- simple definitions for the log format\n- log messages may contains text styles and color, using ANSI codes; this helps readability\n- typeclass-based support for logging different types of object\n\n\n## Availability\n\n\n\n\n\n\n\n## Getting Started\n\n### Defining a logger\n\nLibraries which use Eucalyptus for logging will need a contextual `Log` instance before they can\nbe used. This may be as simple as defining a `given Log` instance in the package where the\nlibraries are used, for example,\n```scala\ngiven Log = logging.silent\n```\nor,\n```scala\ngiven Log = logging.stdout\n```\nor,\n```scala\ngiven Log = logging.syslog\n```\n\nA more versatile `Log` can route different log messages to different targets, for example,\n```scala\ngiven Log = Log.route:\n  case Level.Fail() =\u003e Err\n  case Level.Warn() =\u003e Out\n  case _            =\u003e Syslog(t\"app\")\n```\nwould log all `FAIL` level messages to standard error, all `WARN` level messages to standard output, and\neverything else to the system log (with the tag `app`).\n\n### Library Code\n\n#### Contextual `Log` instances\n\nAny method which requires logging should request a contextual `Log` parameter. This\nis as simple as adding the parameter block, `(using Log)` to the method. Any methods\nwhich call such a method will also need to include a `using Log` parameter.\n\n#### Log messages\n\nMessages may be logged (at a particular level) by calling one of four methods,\n- `Log.fine`\n- `Log.info`\n- `Log.warn`\n- `Log.fail`\npassing the single parameter of a `Message` containing the message to be logged.\n\n#### Realm\n\nThese four methods require a contextual `Realm` instance in scope so that the source of log messages can be\neasily discerned from logs. Conventionally, this would \nbe declared in the main application package, and called `Realm`, like so,\n```scala\npackage mylibrary\ngiven Realm: Realm = realm\"mylibrary\"\n```\nwhere `mylibrary` is the name that will appear in the logs. The name `realm` is given\nexplicitly so that a user-defined `Log` instance may be configured to reference this\nrealm within the package `mylibrary`, for example:\n```scala\ngiven Log = Log.route:\n  case myLibrary.Realm =\u003e Out\n```\n\nSince `given` instances are not imported by default with a wildcard import, a `Realm`\ndefinition does not need to be marked as private.\n\n### Configuration\n\nWhen working with libraries such as [Scintillate](https://github.com/propensive/scintillate) or\n[Guillotine](https://github.com/propensive/guillotine), whose methods require\na `Log` instance, it is possible to selectively include logs from specific libraries,\nby referring to that library's realm, for example:\n```scala\ngiven Log = Log.route:\n  case scintillate.Realm =\u003e Out\n```\nA level may also be specified:\n```scala\ngiven Log = Log.route:\n  case Level.Warn() | Level.Fail() =\u003e Err\n```\n\nAnd multiple rules may be included as multiple cases in the `Log` constructor, where the `\u0026` pattern operator\ncan be used to match on more than one property, for example:\n```scala\ngiven Log = Log.route:\n  case scintillate.Realm \u0026 Info() =\u003e Out\n  case guillotine.Realm \u0026 Warn()  =\u003e Err\n  case probably.Realm             =\u003e Out\n```\n\n\n\n\n\n## Status\n\nEucalyptus is classified as __fledgling__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nEucalyptus is designed to be _small_. Its entire source code currently consists\nof 207 lines of code.\n\n## Building\n\nEucalyptus will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Eucalyptus?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Eucalyptus's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Eucalyptus and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `eucalyptus`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Eucalyptus's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Eucalyptus are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/eucalyptus/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Eucalyptus\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nEucalyptus was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nThe _Eucalyptus_ tree is flexible and good for logging.\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo shows the cut cross section of a (supposedly) Eucalyptus tree, with a leaf alongside.\n\n## License\n\nEucalyptus is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Feucalyptus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Feucalyptus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Feucalyptus/lists"}