{"id":14068148,"url":"https://github.com/ryapric/loggit","last_synced_at":"2025-06-27T22:05:48.382Z","repository":{"id":29276240,"uuid":"121062509","full_name":"ryapric/loggit","owner":"ryapric","description":"Modern Logging for the R Ecosystem","archived":false,"fork":false,"pushed_at":"2023-12-14T12:22:46.000Z","size":164,"stargazers_count":38,"open_issues_count":13,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-27T22:05:24.519Z","etag":null,"topics":["exception-handler","logging","r"],"latest_commit_sha":null,"homepage":"","language":"R","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/ryapric.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","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":"2018-02-10T23:09:42.000Z","updated_at":"2025-03-05T00:54:08.000Z","dependencies_parsed_at":"2024-08-13T07:13:51.662Z","dependency_job_id":"b28f8db5-9e5c-4c1c-ae78-440ee79b712b","html_url":"https://github.com/ryapric/loggit","commit_stats":{"total_commits":112,"total_committers":4,"mean_commits":28.0,"dds":0.3035714285714286,"last_synced_commit":"dd4afecbd54826ec91b3cc11dc680775fd4b5855"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ryapric/loggit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryapric%2Floggit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryapric%2Floggit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryapric%2Floggit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryapric%2Floggit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryapric","download_url":"https://codeload.github.com/ryapric/loggit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryapric%2Floggit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262341619,"owners_count":23296069,"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":["exception-handler","logging","r"],"created_at":"2024-08-13T07:05:58.958Z","updated_at":"2025-06-27T22:05:48.354Z","avatar_url":"https://github.com/ryapric.png","language":"R","readme":"---\ntitle: \"README\"\noutput:\n  md_document:\n    variant: gfm\nvignette: \u003e\n  %\\VignetteIndexEntry{README}\n  %\\VignetteEngine{knitr::rmarkdown}\n  %\\VignetteEncoding{UTF-8}\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\"\n)\n```\n\nModern Logging for the R Ecosystem\n==================================\nRyan Price \u003cryapric@gmail.com\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN\\_Status\\_Badge](http://www.r-pkg.org/badges/version/loggit)](https://cran.r-project.org/package=loggit)\n[![R-CMD-check](https://github.com/ryapric/loggit/workflows/R-CMD-check/badge.svg)](https://github.com/ryapric/loggit/actions)\n[![Monthly downloads](https://cranlogs.r-pkg.org/badges/loggit)](https://cran.r-project.org/package=loggit)\n[![Support me on Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/ryapric)\n\u003c!-- badges: end --\u003e\n\n------------------------------------------------------------------------\n\n`loggit` is an [`ndJSON`](https://github.com/ndjson/ndjson-spec) logging library\nfor R software. It is blazingly fast when writing logs, and has _zero_ external\ndependencies. `loggit` can be as simple and unobstrusive as you'd like, or as\ninvolved as your application needs it to be.\n\nPlease see below for some quick examples, and [read the\nvignettes](https://cran.r-project.org/web/packages/loggit/vignettes/) for the\nGetting Started guide, as well as some other use case examples.\n\nWhy use `loggit`?\n-----------------\n\nThere are indeed several logging packages available for R. `loggit`, however,\ntakes a more modern approach approach to logging in R:\n\n- Opting to use the JSON format, which is parsable by most modern software\n- Designed with log streams in mind\n- Unobtrusive, yet highly flexible\n- Convenient ability to log data, then analyze that log data on the same host.\n\nAdditionally, the boilerplate to get going with `loggit` is minimal at worst,\nonly requiring you to point to the log file. If deploying your R code in a\ncontainer ecosystem, you don't even need to do that, since `loggit` will\necho its formatted logs to `stdout`. No need to write custom formatters,\nhandlers, levels, etc. -- ***just f\u0026ck#n' loggit!***\n\nQuick Examples\n--------------\n\nThe quickest way to get up \u0026 running with `loggit` is to... do nothing special.\n`loggit`'s simplest functionality does its best to stay out of your way. You'll\nprobably want to point it to a log file, though; otherwise, logs will print to\nthe console, but land in a tempfile.\n\n```{r handlers}\nlibrary(loggit)\n# set_logfile(\"./loggit.log\")\n\nmessage(\"This is a message\")\nwarning(\"This is a warning\")\n# stop(\"This actually throws a critical error, so I'm not actually going to run it here :)\"))\n#\u003e {\"timestamp\": \"2020-05-31T20:59:33-0500\", \"log_lvl\": \"ERROR\", \"log_msg\": \"This actually throws a critical error, so I'm not actually going to run it here :)\"}\n\n```\n\nYou can suppress each part of the console output separately (both the `loggit`\nndJSON and the regular R output) but the default is to post both. Only the\nndJSON is written to the log file.\n\nYou can also use the `loggit()` function directly to compose much more custom\nlogs, including ***entirely custom fields*** (and prevent throwing actual status\ncodes until you wish to handle them). `loggit` doesn't require that you set\ncustom logger objects or anything like that: just throw whatever you want at it,\nand it'll become a structured log.\n\n```{r loggit}\nloggit(\"ERROR\", \"This will log an error - but not actually throw one yet\", rows = nrow(iris), anything_else = \"you want to include\")\n\n# Read log file into data frame to implement logic based on entries\nlogdata \u003c- read_logs()\nprint(logdata)\nif (any(logdata$log_lvl == \"ERROR\")) {\n  print(\"Errors detected somewhere in your code!\") # but you can throw a stop() here, too, for example\n}\n```\n\nAgain, [check out the\nvignettes](https://cran.r-project.org/web/packages/loggit/vignettes/) for more\ndetails!\n\nInstallation\n------------\n\nYou can install the latest CRAN release of `loggit` via\n`install.packages(\"loggit\")`.\n\nOr, to get the latest development version from GitHub --\n\nVia [devtools](https://github.com/hadley/devtools):\n\n    devtools::install_github(\"ryapric/loggit\")\n\nOr, clone \u0026 build from source:\n\n    cd /path/to/your/repos\n    git clone https://github.com/ryapric/loggit.git loggit\n    make install\n\nTo use the most recent development version of `loggit` in your own package, you\ncan include it in your `Remotes:` field in your DESCRIPTION file:\n\n    Remotes: github::ryapric/loggit\n\nNote that packages being submitted to CRAN *cannot* have a `Remotes` field.\nRefer\n[here](https://cran.r-project.org/web/packages/devtools/vignettes/dependencies.html)\nfor more info.\n\nLicense\n-------\n\nMIT\n","funding_links":["https://ko-fi.com/ryapric"],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryapric%2Floggit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryapric%2Floggit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryapric%2Floggit/lists"}