{"id":21126007,"url":"https://github.com/julialogging/miniloggers.jl","last_synced_at":"2025-03-14T11:42:07.483Z","repository":{"id":40507540,"uuid":"345964979","full_name":"JuliaLogging/MiniLoggers.jl","owner":"JuliaLogging","description":"Julia logger with customizable logging string","archived":false,"fork":false,"pushed_at":"2024-02-19T14:40:56.000Z","size":611,"stargazers_count":13,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T22:43:05.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaLogging.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}},"created_at":"2021-03-09T10:16:22.000Z","updated_at":"2024-03-10T05:44:10.000Z","dependencies_parsed_at":"2024-02-19T16:03:48.873Z","dependency_job_id":null,"html_url":"https://github.com/JuliaLogging/MiniLoggers.jl","commit_stats":{"total_commits":43,"total_committers":2,"mean_commits":21.5,"dds":"0.023255813953488413","last_synced_commit":"e0dc981cef28714b3f5be6b43b9dd5f424ff6048"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaLogging%2FMiniLoggers.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaLogging%2FMiniLoggers.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaLogging%2FMiniLoggers.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaLogging%2FMiniLoggers.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaLogging","download_url":"https://codeload.github.com/JuliaLogging/MiniLoggers.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243573168,"owners_count":20312879,"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-20T04:38:45.106Z","updated_at":"2025-03-14T11:42:07.456Z","avatar_url":"https://github.com/JuliaLogging.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniLoggers.jl\n\n|                                                                                                    **Documentation**                                                                                                    |                                                                                                                              **Build Status**                                                                                                                              |                                                                                                              **JuliaHub**                                                                                                              |\n|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n| [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaLogging.github.io/MiniLoggers.jl/stable)[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaLogging.github.io/MiniLoggers.jl/dev) | [![Build](https://github.com/JuliaLogging/MiniLoggers.jl/workflows/CI/badge.svg)](https://github.com/JuliaLogging/MiniLoggers.jl/actions)[![Coverage](https://codecov.io/gh/JuliaLogging/MiniLoggers.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaLogging/MiniLoggers.jl) | [![pkgeval](https://juliahub.com/docs/MiniLoggers/pkgeval.svg)](https://juliahub.com/ui/Packages/MiniLoggers/5ppWi)[![version](https://juliahub.com/docs/MiniLoggers/version.svg)](https://juliahub.com/ui/Packages/MiniLoggers/5ppWi) |\n\n`MiniLoggers.jl` provides Julia logger with minimal setup and simple yet powerful format of logging strings. It allows to build custom and compact logging, which supports coloring, output to external files, timestamps and many more.\n\n# Installation\n\n`MiniLoggers.jl` is a part of General registry, so it should be installed with\n\n```julia\njulia\u003e using Pkg; Pkg.add(\"MiniLoggers\")\n```\n\n# Examples of usage\n\nIn it's most simple form, `MiniLoggers.jl` is used as\n```julia\nusing MiniLoggers\n\nMiniLogger(minlevel = MiniLoggers.Debug) |\u003e global_logger\n\nx = 1\ny = \"asd\"\n\n@debug \"Values: \" x y\n@info \"Values: \" x y\n@warn \"Values: \" x y\n@error \"Values: \" x y\n```\n\nand produces \n\n![default_fmt](images/default_fmt2.png)\n\nBut one can make it more colourful and add more details with initilization like the following\n\n```julia\nMiniLogger(minlevel = MiniLoggers.Debug, \n           format = \"{[{timestamp}] - {level} - :func}{{module}@{basename}:{line:cyan}:light_green}: {message}\") |\u003e global_logger\n\n@debug \"Values: \" x y\n@info \"Values: \" x y\n@warn \"Values: \" x y\n@error \"Values: \" x y\n```\n\nwhich yields\n\n![colour1_fmt](images/colour1_fmt.png)\n\nOr, we can add small unicode magic and get fancy two-line logging format\n\n```julia\nMiniLogger(minlevel = MiniLoggers.Debug, \n           format = \"╭{[{timestamp}] - {level} - :func}{{module}@{basename}:{line:cyan}:light_green}\\n╰→ {message}\") |\u003e global_logger\n```\n\n![colour3_fmt](images/colour3_fmt.png)\n\nFormat constructor is very flexible, so the output of log messages is mostly limited by your imagination.\n\nAt the same time, you can go other way arround and remove all extra details completely turning it effectively to a basic `println` command, thus making it convinient to plug minilogger in packages like [LoggingExtras.jl](https://github.com/JuliaLogging/LoggingExtras.jl)\n\n```julia\nMiniLogger(minlevel = MiniLoggers.Debug, format = \"{message}\") |\u003e global_logger\n```\n\n![minimal_fmt](images/minimal_fmt.png)\n\nAlso `MiniLoggers.jl` support Julia exceptions, so you can generate error messages in a usual way\n\n```julia\nMiniLogger(minlevel = MiniLoggers.Debug, \n           format = \"{[{timestamp}] {level}:func} {module}@{basename}:{line:cyan}: {message}\") |\u003e global_logger\n\ntry\n    error(\"Some error\")\ncatch err\n    @error (err, catch_backtrace())\nend\n```\n\n![error_fmt](images/error_fmt.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulialogging%2Fminiloggers.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulialogging%2Fminiloggers.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulialogging%2Fminiloggers.jl/lists"}