{"id":28908616,"url":"https://github.com/predatorx7/loggerli","last_synced_at":"2025-10-27T17:05:08.998Z","repository":{"id":64424108,"uuid":"575591179","full_name":"predatorx7/loggerli","owner":"predatorx7","description":"This is a small light weight logger that provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger. The logs emitted can be listened by multiple listeners. This is completely based on pub.dev/packages/logging.","archived":false,"fork":false,"pushed_at":"2022-12-08T07:07:02.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-03-09T07:23:19.793Z","etag":null,"topics":["logging","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/predatorx7.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}},"created_at":"2022-12-07T21:26:05.000Z","updated_at":"2022-12-08T05:02:13.000Z","dependencies_parsed_at":"2022-12-31T19:18:11.285Z","dependency_job_id":null,"html_url":"https://github.com/predatorx7/loggerli","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/predatorx7/loggerli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorx7%2Floggerli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorx7%2Floggerli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorx7%2Floggerli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorx7%2Floggerli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/predatorx7","download_url":"https://codeload.github.com/predatorx7/loggerli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorx7%2Floggerli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261160547,"owners_count":23118185,"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":["logging","python","python3"],"created_at":"2025-06-21T16:41:03.867Z","updated_at":"2025-10-27T17:05:08.992Z","avatar_url":"https://github.com/predatorx7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loggerli\r\n\r\nThis is a small light weight logger that provides APIs for debugging and error\r\nlogging, similar to loggers in other languages, such as the Closure JS Logger\r\nand java.util.logging.Logger. The logs emitted can be listened by multiple\r\nlisteners.\r\n\r\n## Initializing\r\n\r\nBy default, the loggerli package does not do anything useful with the log\r\nmessages. You must configure the logging level and add a handler for the log\r\nmessages.\r\n\r\nHere is a simple logging configuration that logs all messages via `print`.\r\n\r\n```python\r\nfrom loggerli.logger import Logger\r\nfrom loggerli.level import Level\r\n\r\nlogger = Logger.create()\r\n\r\nLogger.root().level = Level.ALL  # defaults to Level.INFO\r\n\r\nlogger.on_record.listen(lambda record: print(f'log {record}'))\r\n\r\nlogger.info('hello world')\r\n```\r\n\r\nFirst, set the root `Level`. All messages at or above the current level are sent\r\nto the `on_record` stream. Available levels are:\r\n\r\n- `Level.OFF`\r\n- `Level.SHOUT`\r\n- `Level.SEVERE`\r\n- `Level.WARNING`\r\n- `Level.INFO`\r\n- `Level.CONFIG`\r\n- `Level.FINE`\r\n- `Level.FINER`\r\n- `Level.FINEST`\r\n\r\nThen, listen on the `on_record` that returns a [Listenable] for `LogRecord`\r\nevents. The `LogRecord` class has various properties for the message, error,\r\nlogger name, and more.\r\n\r\n## Logging messages\r\n\r\nCreate a `Logger` with a unique name to easily identify the source of the log\r\nmessages.\r\n\r\n```python\r\nlog = Logger.create('MyClassName')\r\n```\r\n\r\nWhen logging more complex messages, you can pass a closure instead that will be\r\nevaluated only if the message is actually logged:\r\n\r\n```dart\r\nlog.fine(lambda: [1, 2, 3, 4, 5])\r\n```\r\n\r\nAvailable logging methods are:\r\n\r\n- `log.shout(logged_content);`\r\n- `log.severe(logged_content);`\r\n- `log.warning(logged_content);`\r\n- `log.info(logged_content);`\r\n- `log.config(logged_content);`\r\n- `log.fine(logged_content);`\r\n- `log.finer(logged_content);`\r\n- `log.finest(logged_content);`\r\n\r\n## Installation \u0026 Usage\r\n\r\nInstall from github using git with\r\n\r\n```\r\npip install git+https://github.com/predatorx7/loggerli.git#egg=loggerli\r\n```\r\n\r\nOnce installed, you can import \u0026 use the library\r\n```\r\nfrom loggerli.logger import Logger\r\nfrom loggerli.level import Level\r\n\r\nlogger = Logger.create()\r\n\r\nlogger.level = Level.ALL\r\n\r\nlogger.on_record.listen(lambda x: print(x))\r\n\r\nlogger.info(\"hello world\")\r\n\r\n```\r\n\r\nIf you want to use a specific commit, branch name, or something else then pass\r\nthat git reference like the below `git-reference`\r\n\r\n```sh\r\npip install git+https://github.com/predatorx7/loggerli.git@git-reference#egg=loggerli\r\n```\r\n\r\nFor example, if I want to install from the `main` branch then my command will be\r\n\r\n```sh\r\npip install git+https://github.com/predatorx7/loggerli.git@main#egg=loggerli\r\n```\r\n\r\n## Note\r\n\r\nThis logger is completely based on https://pub.dev/packages/logging.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredatorx7%2Floggerli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpredatorx7%2Floggerli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredatorx7%2Floggerli/lists"}