{"id":28821250,"url":"https://github.com/cuioss/cui-test-juli-logger","last_synced_at":"2025-10-19T19:05:58.255Z","repository":{"id":65973860,"uuid":"584817940","full_name":"cuioss/cui-test-juli-logger","owner":"cuioss","description":"Provides some classes simplifying the configuration and asserting of logging in the context of unit-tests","archived":false,"fork":false,"pushed_at":"2025-05-09T14:57:42.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-09T15:49:45.770Z","etag":null,"topics":["java","junit-jupiter","logging"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuioss.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-03T15:39:35.000Z","updated_at":"2025-05-09T14:56:49.000Z","dependencies_parsed_at":"2023-11-07T00:39:33.546Z","dependency_job_id":"5f6a1575-d9bf-4e4f-890c-22d14c57719d","html_url":"https://github.com/cuioss/cui-test-juli-logger","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"cuioss/cui-java-module-template","purl":"pkg:github/cuioss/cui-test-juli-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fcui-test-juli-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fcui-test-juli-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fcui-test-juli-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fcui-test-juli-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuioss","download_url":"https://codeload.github.com/cuioss/cui-test-juli-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fcui-test-juli-logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260640692,"owners_count":23040505,"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":["java","junit-jupiter","logging"],"created_at":"2025-06-18T22:06:06.972Z","updated_at":"2025-10-19T19:05:58.242Z","avatar_url":"https://github.com/cuioss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= cui-test-juli-logger\n\n== Status\n\nimage:https://github.com/cuioss/cui-test-juli-logger/actions/workflows/maven.yml/badge.svg[Java CI with Maven,link=https://github.com/cuioss/cui-test-juli-logger/actions/workflows/maven.yml]\nimage:http://img.shields.io/:license-apache-blue.svg[License,link=http://www.apache.org/licenses/LICENSE-2.0.html]\nimage:https://img.shields.io/maven-central/v/de.cuioss.test/cui-test-juli-logger.svg[Maven Central,link=https://central.sonatype.com/artifact/de.cuioss.test/cui-test-juli-logger]\n\nhttps://sonarcloud.io/summary/new_code?id=cuioss_cui-test-juli-logger[image:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-test-juli-logger\u0026metric=alert_status[Quality\nGate Status]]\nimage:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-test-juli-logger\u0026metric=ncloc[Lines of Code,link=https://sonarcloud.io/summary/new_code?id=cuioss_cui-test-juli-logger]\nimage:https://sonarcloud.io/api/project_badges/measure?project=cuioss_cui-test-juli-logger\u0026metric=coverage[Coverage,link=https://sonarcloud.io/summary/new_code?id=cuioss_cui-test-juli-logger]\n\nhttps://cuioss.github.io/cui-test-juli-logger/about.html[Generated Documentation on github-pages]\n\n== What is it? \n\nProvides some classes simplifying the configuration and asserting of logging in the context of unit-tests.\n\n=== Maven Coordinates\n\n[source,xml]\n----\n    \u003cdependency\u003e\n        \u003cgroupId\u003ede.cuioss.test\u003c/groupId\u003e\n        \u003cartifactId\u003ecui-test-juli-logger\u003c/artifactId\u003e\n    \u003c/dependency\u003e\n----\n\n== How To use it\n\nEnable for a unit-test\n\n[source,java]\n----\n@EnableTestLogger\nclass PortalHealthServletTest {}\n----\n\nConfigure for all tests\n\n[source,java]\n----\n@EnableTestLogger(rootLevel = TestLogLevel.INFO, trace = List.class, error = Set.class)\nclass PortalHealthServletTest {}\n----\n\nThe logger and level are resetted for each test\n\nAsserting log statements: written or not:\n\n[source,java]\n----\n@EnableTestLogger\nclass PortalHealthServletTest {\n\n    @Test\n    void shouldAssertLogs() {\n        LogAsserts.assertLogMessagePresent(TestLogLevel.DEBUG, \"Should be there at least once\");\n        LogAsserts.assertSingleLogMessagePresent(TestLogLevel.INFO, \"Should be there exactly once\");\n        LogAsserts.assertLogMessagePresentContaining(TestLogLevel.INFO, \"part of the expected message\");\n        LogAsserts.assertNoLogMessagePresent(TestLogLevel.WARN, PortalHealthServlet.class);\n        // and many more asserts\n    }\n----\n\nChanging LogLevel dynamically:\n\n[source,java]\n----\n    TestLogLevel.DEBUG.addLogger(PortalHealthServlet.class);\n    // Set Root-level to debug\n    TestLogLevel.DEBUG.setAsRootLevel();\n----\n\nAdvanced Usage:\n\n[source,java]\n----\n    // Programmatic Setup and teardown, usually done by EnableTestLogger / TestLoggerController\n   TestLoggerFactory.install();\n   TestLoggerFactory.uninstall();\n   \n   // Access the TestLogHandler (for advanced queries not covered by LogAsserts)\n   TestLoggerFactory.getTestHandler();\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuioss%2Fcui-test-juli-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuioss%2Fcui-test-juli-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuioss%2Fcui-test-juli-logger/lists"}