{"id":13502718,"url":"https://github.com/ccampbell/chromelogger-python","last_synced_at":"2025-09-12T07:36:19.597Z","repository":{"id":7903931,"uuid":"9285336","full_name":"ccampbell/chromelogger-python","owner":"ccampbell","description":"Python library for logging variables to Google Chrome console","archived":false,"fork":false,"pushed_at":"2023-09-24T21:26:06.000Z","size":20,"stargazers_count":234,"open_issues_count":8,"forks_count":23,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-08-19T02:59:57.989Z","etag":null,"topics":["console","logging","middleware","python","python-library"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccampbell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-04-08T00:05:46.000Z","updated_at":"2025-03-23T16:16:31.000Z","dependencies_parsed_at":"2024-01-18T23:22:56.001Z","dependency_job_id":"3bd604ae-ca0a-4ee0-a535-a8e9adbb4b6b","html_url":"https://github.com/ccampbell/chromelogger-python","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":0.08333333333333337,"last_synced_commit":"f5d225f2239f747df1f6a7649ba5ae223bb4fdea"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ccampbell/chromelogger-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccampbell%2Fchromelogger-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccampbell%2Fchromelogger-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccampbell%2Fchromelogger-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccampbell%2Fchromelogger-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccampbell","download_url":"https://codeload.github.com/ccampbell/chromelogger-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccampbell%2Fchromelogger-python/sbom","scorecard":{"id":268859,"data":{"date":"2025-08-11","repo":{"name":"github.com/ccampbell/chromelogger-python","commit":"f5d225f2239f747df1f6a7649ba5ae223bb4fdea"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/29 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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T12:51:43.080Z","repository_id":7903931,"created_at":"2025-08-17T12:51:43.081Z","updated_at":"2025-08-17T12:51:43.081Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274777065,"owners_count":25347643,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["console","logging","middleware","python","python-library"],"created_at":"2024-07-31T22:02:23.294Z","updated_at":"2025-09-12T07:36:19.556Z","avatar_url":"https://github.com/ccampbell.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Overview\n\nChromelogger is a Python library for logging variables to the Google Chrome console using the Chrome Logger extension.\n\nFor more information about Chrome Logger check out [http://chromelogger.com](http://chromelogger.com).\n\nThis module is designed to be used during development and not in production.  It is not thread safe, and you do not want to risk leaking sensitive data to users!\n\n## Getting Started\n\n1. Install [Chrome Logger](https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd) from the Chrome Web Store\n\n2.  Click the extension icon to enable on the current tab's domain\n\n    ![toggling](http://cdn.craig.is/img/chromelogger/toggle.gif)\n\n3. Install the Python library\n\n    ```python\n    pip install chromelogger\n    ```\n\n4.  Start logging\n\n    ```python\n    import chromelogger as console\n    console.log('Hello console!')\n    console.get_header()\n    ```\n\n## Sending Headers\n\nSince every framework deals with setting headers slightly differently the library stores the header information and it is up to you to send it at the end of your request.\n\n### Using with Django\n\nThe library includes a middleware for using with Django.  All you have to do is in your ``settings.py`` file make sure to update your list of middleware and add\n\n```python\nMIDDLEWARE_CLASSES = (\n    'chromelogger.DjangoMiddleware'\n)\n```\n\nAfter that you can import the chromelogger class from any file in your application and add logs.\n\n### Using with Tornado\n\nUsing with tornado is slightly more complicated.  You have to make sure you are using your own custom request handler and that all your requests you want logged inherit from that.  Here is an example of how you could implement it\n\n```python\nimport tornado\nimport chromelogger\n\nclass CustomRequestHandler(tornado.web.RequestHandler):\n    def finish(self, chunk=None):\n        header = chromelogger.get_header()\n\n        if header is not None:\n\n            # in Tornado RequestHandler.set_header() function limits\n            # header length to 1000 bytes, so set directly for this case\n            self._headers[header[0]] = header[1]\n\n        return super(CustomRequestHandler, self).finish(chunk=chunk)\n```\n\n### Using with Flask\n\nFor using chromelogger with Flask, you can use a custom response-handler like this:\n\n```python\n# put this somewhere in your application setup\n\nif app.debug:\n    import chromelogger as console\n \n    @app.after_request\n    def chromelogger(response):\n        header = console.get_header()\n        if header is not None:\n            response.headers.add(*header)\n        return response\n```\n\nThis ensures that chromelogger is only active, if the apllication runs in debug-mode.\n\n## API Documentation\n\nThe chromelogger module exposes some of the chrome logger methods.  The others will be coming in a future release.\n\n### chromelogger.log(*args)\n### chromelogger.warn(*args)\n### chromelogger.error(*args)\n### chromelogger.info(*args)\n### chromelogger.group(*args)\n### chromelogger.group_end(*args)\n### chromelogger.group_collapsed(*args)\n### chromelogger.table(*args)\n\nLogs data to the console.  You can pass any number of arguments just as you would in the browser.\n\n```python\nchromelogger.log('width', width, 'height', height)\n```\n\n### chromelogger.version\n\nOutputs a string of the current version of this module\n\n### chromelogger.get_header(flush=True)\n\nReturns a tuple with the header name and value to set in order to transmit your logs.\n\nIf ``flush`` argument is ``True`` all the data stored during this request will be flushed.\n\nThis is the preferred way to use this module.  At the end of each request you should call this method and add this header to the response.\n\n```python\nimport chromelogger\nchromelogger.log(123)\nchromelogger.get_header()\n# ('X-ChromeLogger-Data', 'eyJyb3dzIjogW1tbMTIzXSwgIjxzdGRpbj4gOiAxIiwgWyJsb2ciXV1dLCAidmVyc2lvbiI6ICIwLjIuMiIsICJjb2x1bW5zIjogWyJsb2ciLCAiYmFja3RyYWNlIiwgInR5cGUiXX0=')\n```\n\n``chromelogger.get_header()`` will return ``None`` if there is no data to log.\n\n### chromelogger.set_header = None\n\nAs an alternative to ``get_header`` you can specify a function that can be used to set a header.  The function should accept two parameters (header name and value).  Usage would look something like:\n\n```python\ndef set_header(name, value):\n    # do stuff here to set header\n    pass\n\nchromelogger.set_header = set_header\n```\n\nWhen ``chromelogger.set_header`` is not equal to ``None`` it will be called each time data is logged to set the header.  The class is a singleton so it will just keep overwriting the same header with more data as more data is added.\n\nIf you are going to use this you have to make sure to call ``chromelogger.reset()`` at the beginning of each request or at the end of each request in order to ensure the same data does not carry over into future requests.\n\n### chromelogger.reset()\n\nClears out any data that has been set during this request.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccampbell%2Fchromelogger-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccampbell%2Fchromelogger-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccampbell%2Fchromelogger-python/lists"}