{"id":36863664,"url":"https://github.com/bnbdr/tracelogging","last_synced_at":"2026-01-12T14:52:05.781Z","repository":{"id":57476817,"uuid":"234575249","full_name":"bnbdr/tracelogging","owner":"bnbdr","description":"Tracelogging Providers in Python","archived":false,"fork":false,"pushed_at":"2022-09-28T15:50:26.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T00:37:18.257Z","etag":null,"topics":["etw","event","logging","python","traceevent","tracing"],"latest_commit_sha":null,"homepage":null,"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/bnbdr.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":"2020-01-17T15:20:05.000Z","updated_at":"2022-09-27T20:04:50.000Z","dependencies_parsed_at":"2022-09-12T15:22:33.691Z","dependency_job_id":null,"html_url":"https://github.com/bnbdr/tracelogging","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bnbdr/tracelogging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnbdr%2Ftracelogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnbdr%2Ftracelogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnbdr%2Ftracelogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnbdr%2Ftracelogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnbdr","download_url":"https://codeload.github.com/bnbdr/tracelogging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnbdr%2Ftracelogging/sbom","scorecard":{"id":245920,"data":{"date":"2025-08-11","repo":{"name":"github.com/bnbdr/tracelogging","commit":"58577e34691fbd6c7bacc9d9e999ded4d35602c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T07:37:06.632Z","repository_id":57476817,"created_at":"2025-08-17T07:37:06.632Z","updated_at":"2025-08-17T07:37:06.632Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["etw","event","logging","python","traceevent","tracing"],"created_at":"2026-01-12T14:52:05.688Z","updated_at":"2026-01-12T14:52:05.763Z","avatar_url":"https://github.com/bnbdr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TraceLogging for Python\r\nThis small package implements a `TraceLoggingProvider` for publishing ETW events in **Windows**.\r\n\r\n\r\n**Use at your own risk.**\r\n\r\n# Requirements\r\n- python 3.8.x\r\n\r\n# Installation\r\n```bash\r\npip install tracelogging\r\n```\r\n\r\n# Usage\r\nAll usage examples are assuming an enabled EventTrace session for the provider(you can use [EtwConsumer](./SampleEtwConsumer/))).\r\n\r\nTheFollowing examples are taken from [here](./examples/)\r\n\r\n## Basic logging for the extremely lazy\r\nSimilar usage to python's own logging. No handlers, no formatters, no `exception` method, no format or additional arguments supported.\r\n\r\n\r\nThe name given to a provider will be used to generate the appropriate GUID the same way `TraceEvent` does.\r\n```py\r\nimport tracelogging\r\nlog = tracelogging.getLogger('MyLoggerName')\r\n\r\nlog.debug('ging')\r\nlog.info('rmation')\r\nlog.warning('be careful')\r\nlog.error('err')\r\nlog.critical('oh no!')\r\n```\r\n\r\n\r\n## Defining your very own provider\r\nDefines a provider named `PythonProvider` that can publish an event named `BasicEvent` without any additional data\r\n```py\r\nfrom tracelogging import Provider, event\r\n\r\nclass PythonProvider(Provider):\r\n    @event() # mind the parentheses\r\n    def BasicEvent(self):\r\n        pass\r\n\r\nlog = PythonProvider()\r\nlog.BasicEvent()\r\n```\r\n\r\n## Advanced usage\r\nYou can override the provider's `Name` directly by setting the `Name` class member to whatever you wish.\r\nSame can be done with the `Guid` member, by setting it to an instance of `UUID` with the desired value.\r\n\r\n\r\nYou can set values for the event's descriptor using the `event` decoraotr, just like you would with `TraceEvent` ([or EVENT_DESCRIPTOR struct](https://docs.microsoft.com/en-us/windows/win32/api/evntprov/ns-evntprov-event_descriptor)). You may also specify an override to the event name.\r\n\r\nIn order to add data to the event, you must use python's type-hinting with the supported types(see Types)\r\n```py\r\nfrom tracelogging import Provider, event, Types, TraceLevel\r\n\r\nclass PythonProvider(Provider):\r\n    Name = 'Company-Product-Component'\r\n\r\n    @event(Name='FileSize', Id=1, Level=TraceLevel.Warning, Keyword=0x01)\r\n    def not_a_nice_event_name(self, file_path:Types.UnicodeString, file_size:Types.UInt32):\r\n        print('this will be called after the event is written, if you wish to implement anything here')\r\n\r\nlog = PythonProvider()\r\nlog.not_a_nice_event_name('C:\\\\windows\\\\system32\\\\calc.exe', 0x1000) # will send event named 'FileSize'\r\n```\r\n\r\n## Current supported types\r\nType | Python | Description\r\n--|--|--\r\n`UnicodeString` | `str` | null terminated UTF-16 string\r\n`CountedUnicodeString` | `str` | size prefix (WORD) followed by UTF-16 string (not terminated)\r\n`UInt32` | `int` | unsigned DWORD\r\n`Int32` | `int` | signed DWORD\r\n`UInt64` | `int` | unsigned QWORD\r\n`Int64` | `int` | signed QWORD\r\n\r\n# Notes\r\n- Read contents of `TraceLoggingProvider.h` header for more info\r\n- Most logic is performed during provider class definition. Instantiation only registers and 'sets' the provider as one capable of sending self-described events\r\n- Providers can inherit events from base classes, though doing so is discouraged.\r\n- Internal code uses a sort of singleton to prevent multiple instances of the same provider\r\n\r\n# License\r\nMIT\r\n\r\n# Troubleshooting\r\nset environment variable `TLG_LOG` to the desired log level (1 for high verbosity, 0 to turn off)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnbdr%2Ftracelogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnbdr%2Ftracelogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnbdr%2Ftracelogging/lists"}