{"id":13932567,"url":"https://github.com/cloudoptlab/cloudopt-logger","last_synced_at":"2025-08-11T06:40:15.286Z","repository":{"id":107360934,"uuid":"149581934","full_name":"cloudoptlab/cloudopt-logger","owner":"cloudoptlab","description":"Cloudopt-logger is an extensible and configurable logging framework extension based on Kotlin, supporting Java, Kotlin and Android.","archived":false,"fork":false,"pushed_at":"2018-10-26T02:52:08.000Z","size":64,"stargazers_count":35,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-04T05:16:02.452Z","etag":null,"topics":["cloudopt","java","kotlin","logger","spring"],"latest_commit_sha":null,"homepage":"https://www.cloudopt.net","language":"Kotlin","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/cloudoptlab.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}},"created_at":"2018-09-20T09:06:42.000Z","updated_at":"2024-09-01T10:28:45.000Z","dependencies_parsed_at":"2023-05-17T05:52:46.444Z","dependency_job_id":null,"html_url":"https://github.com/cloudoptlab/cloudopt-logger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cloudoptlab/cloudopt-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudoptlab%2Fcloudopt-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudoptlab%2Fcloudopt-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudoptlab%2Fcloudopt-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudoptlab%2Fcloudopt-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudoptlab","download_url":"https://codeload.github.com/cloudoptlab/cloudopt-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudoptlab%2Fcloudopt-logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269842875,"owners_count":24484107,"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-11T02:00:10.019Z","response_time":75,"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":["cloudopt","java","kotlin","logger","spring"],"created_at":"2024-08-07T21:01:07.955Z","updated_at":"2025-08-11T06:40:15.247Z","avatar_url":"https://github.com/cloudoptlab.png","language":"Kotlin","readme":"![Cloudopt Next](https://github.com/cloudoptlab/cloudopt-next/raw/master/logo.png)\n\n[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Apache Licenses Badge](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Twitter Badge](https://img.shields.io/twitter/url/http/shields.io.svg?style=social\u0026logo=twitter)](https://twitter.com/CloudoptLab)\n\n\nCloudopt-logger is an extensible and configurable logging framework extension based on Kotlin, supporting Java, Kotlin and Android.\n\n![screenshot](https://github.com/cloudoptlab/cloudopt-logger/raw/master/screenshots/01.jpg)\n![screenshot](https://github.com/cloudoptlab/cloudopt-logger/raw/master/screenshots/02.jpg)\n\nFeatures:\n\n\n- supports color log output.\n\n- support multiple logging frameworks, such as Slf4j, Log4j, and so on.\n\n- easy to extend.\n\n- more user-friendly and convenient to debug output.\n\n[中文文档](https://github.com/cloudoptlab/cloudopt-logger/blob/master/README_ZH.md)\n\n# Installation\n\nIntroduce in Maven:\n\n````xml\n  \u003cdependency\u003e\n    \u003cgroupId\u003enet.cloudopt.logger\u003c/groupId\u003e\n    \u003cartifactId\u003ecloudopt-logger\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.1\u003c/version\u003e\n  \u003c/dependency\u003e\n````\nIf you are using Slf4j, you need to introduce the appropriate libraries, such as:\n\n````xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-api\u003c/artifactId\u003e\n    \u003cversion\u003e1.7.25\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ech.qos.logback\u003c/groupId\u003e\n    \u003cartifactId\u003elogback-classic\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.3\u003c/version\u003e\n\u003c/dependency\u003e\n````\n\n## How to use\n\nSimple to use, just introduce the Logger class. Here are a few examples:\n\n````kotlin\npackage net.cloudopt.logger\n\nimport org.junit.Test\n\nclass TestCase {\n\n    private val logger = Logger.getLogger(TestCase::class.java)\n\n    @Test\n    fun example1() {\n        logger.debug(\"Start init....\")\n        logger.info(\"Operation successful!\")\n        logger.warn(\"The value must be not nul.\")\n        logger.error(\"Unable to acquire lock!\")\n    }\n\n    @Test\n    fun example2() {\n        logger.info(\"Please Wait.... ${Colorer.blue(\"100\")}\")\n        logger.info(\"Please Wait.... ${Colorer.yellow(\"200\")}\")\n        logger.info(\"Please Wait.... ${Colorer.red(\"300\")}\")\n    }\n\n    @Test\n    fun example3() {\n        val configuration = LoggerConfiguration()\n        configuration.run {\n            this.color = false\n        }\n        Logger.configuration = configuration\n        example1()\n    }\n\n    @Test\n    fun example4() {\n        val configuration = LoggerConfiguration()\n        configuration.run {\n            this.debugPrefix = \"DEBUG\"\n            this.infoPrefix = \"INFO\"\n            this.warnPrefix = \"WARN\"\n            this.errorPrefix = \"ERROR\"\n        }\n        Logger.configuration = configuration\n        example1()\n    }\n}\n````\n\n````java\npublic class TestJavaCase {\n    private Logger logger = Logger.Companion.getLogger(TestCase.class);\n\n    @Test\n    public void example1() {\n        logger.debug(\"Start init....\");\n        logger.info(\"Operation successful!\");\n        logger.warn(\"The value must be not nul.\");\n        logger.error(\"Unable to acquire lock!\");\n    }\n\n    @Test\n    public void example2() {\n        logger.info(\"Please Wait.... \" + Colorer.INSTANCE.blue(\"100\"));\n        logger.info(\"Please Wait.... \" + Colorer.INSTANCE.yellow(\"200\"));\n        logger.info(\"Please Wait.... \" + Colorer.INSTANCE.red(\"300\"));\n    }\n\n    @Test\n    public void example3() {\n        LoggerConfiguration configuration = new LoggerConfiguration();\n        configuration.setColor(false);\n        Logger.Companion.setConfiguration(configuration);\n        example1();\n    }\n\n    @Test\n    public void example4() {\n        LoggerConfiguration configuration = new LoggerConfiguration();\n        configuration.setDebugPrefix(\"DEBUG\");\n        configuration.setInfoPrefix(\"INFO\");\n        configuration.setWarnPrefix(\"WARN\");\n        configuration.setErrorPrefix(\"ERROR\");\n        Logger.Companion.setConfiguration(configuration);\n        example1();\n    }\n}\n````\n\nIf you want to change the color of any output character, just wrap it in a Colorer. Eight colors are already built in.\n\n## How to extend\n\nSupport for Slf4j is now built in, and with Slf4j you can support logback, log4j, log4j2, etc. If you need to support it directly or support other logging frameworks, you can do so by referring to Slf4jLoggerProvider.\n\n## Follow us\n\nYou can focus on our [twitter](https://twitter.com/CloudoptLab) or is to focus on the micro letter, public the latest news we will via twitter or released to the public.\n\n![](https://github.com/cloudoptlab/cloudopt-logger/raw/master/screenshots/qrcode.jpg)","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudoptlab%2Fcloudopt-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudoptlab%2Fcloudopt-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudoptlab%2Fcloudopt-logger/lists"}