{"id":29294800,"url":"https://github.com/delphi-blocks/logify","last_synced_at":"2026-02-04T11:11:58.919Z","repository":{"id":298349198,"uuid":"788973102","full_name":"delphi-blocks/Logify","owner":"delphi-blocks","description":"Logify MetaLogger for Delphi","archived":false,"fork":false,"pushed_at":"2025-07-04T14:28:24.000Z","size":548,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-04T15:11:16.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pascal","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/delphi-blocks.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,"zenodo":null}},"created_at":"2024-04-19T13:03:25.000Z","updated_at":"2025-07-04T14:28:27.000Z","dependencies_parsed_at":"2025-06-10T18:02:58.009Z","dependency_job_id":null,"html_url":"https://github.com/delphi-blocks/Logify","commit_stats":null,"previous_names":["delphi-blocks/logify"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/delphi-blocks/Logify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delphi-blocks%2FLogify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delphi-blocks%2FLogify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delphi-blocks%2FLogify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delphi-blocks%2FLogify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delphi-blocks","download_url":"https://codeload.github.com/delphi-blocks/Logify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delphi-blocks%2FLogify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263905770,"owners_count":23527978,"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":[],"created_at":"2025-07-06T13:13:14.285Z","updated_at":"2026-02-04T11:11:53.888Z","avatar_url":"https://github.com/delphi-blocks.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logify: meta-logger for Delphi 📝\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logify.png\" alt=\"Logify Library\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n## Logify: what is it ❓\n\nIn modern software development, logging is indispensable for monitoring application health, debugging issues, and understanding user behavior. However, traditional logging approaches in Delphi often lead to tightly coupled code, where your application's business logic directly depends on a specific logging framework's classes and units. This creates a dependency, making it difficult to swap out loggers, introduces unnecessary compilation dependencies, and hinders testability. If you decide to change your logging backend to another solution, you're faced with a potentially large-scale refactoring effort across your entire codebase.\n\n**Logify**, a new meta-logger for Delphi, is designed to liberate your applications from these rigid logging dependencies. Inspired by best practices seen in frameworks like .NET's `ILogger` interface, Logify's primary purpose is to provide a **simple, yet powerful, interface-based abstraction for logging**.\n\nAt its core, Logify introduces an `ILogger` interface that your application code will interact with exclusively. This means:\n\n* **No Direct Logger Class Dependency:** Your business units will never directly reference `TMyLoggerSpecificClass` or `MyLoggerUnit.pas`. Instead, they'll simply \"ask\" for an `ILogger` instance.\n\n* **True Decoupling:** The choice of the underlying logging implementation (e.g., writing to file, database, console, or a third-party logging library) is entirely handled by Logify's configuration and composition layer, completely outside your core application logic.\n\n* **Enhanced Testability:** With an interface-based approach, you can easily mock or stub the `ILogger` interface during unit tests, ensuring that your tests focus purely on the business logic without generating actual log output or requiring a real logging setup.\n\n* **Future-Proofing:** Should your logging requirements change, or a new, superior logging framework emerge, the transition becomes a matter of updating Logify's configuration and providing a new implementation of the `ILogger` interface, rather than modifying hundreds or thousands of lines of application code.\n\n* **Cleaner Codebase:** By centralizing logging concerns behind an interface, your application code remains cleaner, more readable, and focused on its primary responsibilities.\n\nLogify acts as an intelligent proxy or a \"meta-logger,\" providing a unified front for various logging backends. It's about shifting the paradigm from \"I use *this* logger\" to \"I need *a* logger,\" empowering Delphi developers to build more flexible, maintainable, and robust applications that are ready for evolution. This introduction will explore how Logify achieves this decoupling and how you can leverage its power to revolutionize your Delphi logging strategy.\n\n## When to use Logify 📎\n\nLogify is an easy interface to logging libraries so it makes sense to use it when you are in a situation where you already use more than a logger library, so you have to change your code one more time but... for the last time :-)\n\nLogify is useful also when you use only one logger library because the reason (for me) that Logify was created is to have the possibility to compile some units with some logging in it in other project can may or may not have need for logging. So, actually, the main feature of Logify is not to log but to do absilutely nothing ;-)\n\nLet me explain with a simple example:\n\n```delphi\n\nuses\n  MyBeautifulLoggerUnit;\n\nprocedure TfrmMain.btnTestClick(Sender: TObject);\nbegin\n  if CheckBox1.Checked then\n  begin\n    Edit1.Text := 'Paolo';\n    // This is a fake line that emulates the API of a generic logger\n    MyLogger.Log('Setting the value of Edit1', INFO); \n  end;\nend;\n```\n\nyou have code like that in a Form (or a DataModule, or a Unit) that generates lines in an already configured logfile and now you want to use this code in a new project but you don't need a logger right now (eventually you'll configure one)... what are your choiches?\n\n1. Remove all the log lines \n2. IFDEF them\n3. Configure the exact same logger (that you don't need)\n\nas you can see all three options require quite some changes to the source code and you have to remember that this unit is shared back with another application!\n\nSo what Logify offers as a solution?\n\n```delphi\nuses\n  Logify;\n\nprocedure TfrmMain.btnTestClick(Sender: TObject);\nbegin\n  if CheckBox1.Checked then\n  begin\n    Edit1.Text := 'Paolo';\n    // This is a simple call from the Logify interface\n    Logger.LogInfo('Setting the value of Edit1');\n  end;\nend;\n```\n\nWith Logify you can reuse this code as is it, without removing or modifying nothing. And later, if the need arise, you can configure properly the `Logger` object.\n\n## Logify Architecture 🏛️\n\n###  The `ILogger` Interface\n\n### The `ILoggerAdapter` Interface\n\n### The `ILoggerAdapterFactory` Interface\n\nDiagram for the Logify library architecture:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"diagram.jpg\" alt=\"Logify Architecture\" width=\"600\" /\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelphi-blocks%2Flogify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelphi-blocks%2Flogify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelphi-blocks%2Flogify/lists"}