{"id":16499412,"url":"https://github.com/tpapp/hdf5logging.jl","last_synced_at":"2026-03-03T22:02:14.749Z","repository":{"id":66832018,"uuid":"357568196","full_name":"tpapp/HDF5Logging.jl","owner":"tpapp","description":"Log to HDF5 files from Julia.","archived":false,"fork":false,"pushed_at":"2021-04-13T13:50:36.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-20T20:04:53.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-04-13T13:43:53.000Z","updated_at":"2025-12-11T02:53:06.000Z","dependencies_parsed_at":"2023-02-21T05:45:28.419Z","dependency_job_id":null,"html_url":"https://github.com/tpapp/HDF5Logging.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tpapp/HDF5Logging.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FHDF5Logging.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FHDF5Logging.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FHDF5Logging.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FHDF5Logging.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpapp","download_url":"https://codeload.github.com/tpapp/HDF5Logging.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpapp%2FHDF5Logging.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30063366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-11T14:52:33.014Z","updated_at":"2026-03-03T22:02:14.721Z","avatar_url":"https://github.com/tpapp.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HDF5Logging.jl\n\n![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg) [![build](https://github.com/tpapp/HDF5Logging.jl/workflows/CI/badge.svg)](https://github.com/tpapp/HDF5Logging.jl/actions?query=workflow%3ACI) [![codecov.io](http://codecov.io/github/tpapp/HDF5Logging.jl/coverage.svg?branch=master)](http://codecov.io/github/tpapp/HDF5Logging.jl?branch=master)\n\n**`HDF5Logging.hdf5_logger`** \u0026mdash; *Function*.\n\n```julia\nhdf5_logger(filename; group_path)\n```\n\nCreate a logger that write log messages into the HDF5 file `filename` within the given `group_path` (defaults to `\"log\"`).\n\n**Logging**\n\nA counter keeps track of an increasing integer index. A log message is written to the given `group_path` as a group named with this index (converted to a string), with the following fields:\n\n  * `level::Int`, `message::String`, `_module::String`, `group::String`, `id::String`, `file::String`, `line::String`, which are part of every log message\n  * `data`, which contains additional key-value pairs as passed on by the user. Keys are strings.\n\n**Reading logs**\n\n`length(logger)` returns the last index of logged messages, which can be be accessed with `logger[i]`. The latter returns a `NamedTuple`, or `nothing` for no such message.\n\n**Example**\n\n```julia-repl\njulia\u003e using HDF5Logging, Logging\n\njulia\u003e logger = hdf5_logger(tempname())\nLogging into HDF5 file /tmp/jl_IbbUvj, 0 messages in “log”\n\njulia\u003e # write log\n\njulia\u003e with_logger(logger) do\n       @info \"very informative\" a = 1\n       end\n\njulia\u003e # read log\n\njulia\u003e logger[1]\n(level = Info, message = \"very informative\", _module = \"Main\", group = \"REPL[46]\", id = \"Main_7a40b9cc\", file = \"REPL[46]\", line = 2, data = [\"a\" =\u003e 1])\n```\n\n**Notes**\n\n1. The HDF5 file can contain other data, ideally in other groups than `group_path`.\n2. Contiguity of message indexes is not checked. This package will create them in order,\nstarting at 1, but if you delete some with another tool then `getindex` will just return `nothing`.\n3. A lock is used, so a shared instance should be thread-safe. That said, **if you open the\nsame file with another `hdf5_logger`, consequences are undefined.**\n4. The HDF5 file is not kept open when not accessed. This is slower, but should help ensure\nrobust operation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fhdf5logging.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpapp%2Fhdf5logging.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpapp%2Fhdf5logging.jl/lists"}