{"id":21390350,"url":"https://github.com/compscidr/logips","last_synced_at":"2025-03-16T13:15:56.937Z","repository":{"id":263897585,"uuid":"891676183","full_name":"compscidr/logips","owner":"compscidr","description":"Simple lib to log ip addresses in kotlin","archived":false,"fork":false,"pushed_at":"2025-03-06T16:57:10.000Z","size":173,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T16:17:13.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compscidr.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-11-20T18:53:22.000Z","updated_at":"2025-03-06T16:56:52.000Z","dependencies_parsed_at":"2024-11-20T22:26:23.183Z","dependency_job_id":"3cfdd068-67cb-4954-8a18-89b8973ad8c1","html_url":"https://github.com/compscidr/logips","commit_stats":null,"previous_names":["compscidr/logips"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compscidr%2Flogips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compscidr%2Flogips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compscidr%2Flogips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compscidr%2Flogips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compscidr","download_url":"https://codeload.github.com/compscidr/logips/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871912,"owners_count":20361380,"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":"2024-11-22T13:17:11.030Z","updated_at":"2025-03-16T13:15:56.901Z","avatar_url":"https://github.com/compscidr.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logips\n[![codecov](https://codecov.io/gh/compscidr/logips/graph/badge.svg?token=Rga4WAHMGu)](https://codecov.io/gh/compscidr/logips)\n\nSimple lib to log ip addresses in kotlin. Allows filtering of interfaces\nby name or up/down status.\n\nCan also just retrieve a list of interfaces with the same filtering applied.\n\n\n\n## Usage:\n```\ndependencies {\n  implementation(\"com.jasonernst.logips:logips\")\n}\n```\n\n```kotlin\nprivate val logger = LoggerFactory.getLogger(\"SomeLogger\")\n// log the ips addresses with the provided logger, excluding the loopback interface\nLogIp.logAllIpAddresses(logger, \"lo\")\n\n// log the ips with the default logger, excluding the default interfaces (vlans, docker, etc)\nLogIp.logAllIpAddresses()\n\n// get all the interfaces except the loopback interface\nval interfaces = LogIp.getInterfaces(excludeInterfaces = listOf(\"lo\"))\n// do something with the interface... \n\n// this just prints the interfaces the same as the logAllIpAddresses function above, but\n// it could be used if you wanted to do something with each ip address\nval interfaceNameIpMap = LogIp.getInterfaceNameAddressMap(excludeInterfaces = listOf(\"lo\"))\nfor (interfaceName in interfaceNameMap.keys) {\n    logger.debug(\"Interface $interfaceName\")\n    val ipAddresses = interfaceNameMap[interfaceName]\n    if (ipAddresses == null) {\n        logger.debug(\"  No ips\")\n    } else {\n        for (ipAddress in ipAddresses) {\n            logger.debug(\"  IP $ipAddress\")\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompscidr%2Flogips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompscidr%2Flogips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompscidr%2Flogips/lists"}