Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop wsgiref.simple_server from logging to stderr by default. #14

Merged
merged 5 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/builder-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Build ${{ matrix.addon }} add-on
if: steps.check.outputs.build_arch == 'true'
uses: home-assistant/builder@2024.01.0
uses: home-assistant/builder@2024.03.5
with:
args: |
${{ env.BUILD_ARGS }} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Build ${{ matrix.addon }} add-on
if: steps.check.outputs.build_arch == 'true'
uses: home-assistant/builder@2024.01.0
uses: home-assistant/builder@2024.03.5
with:
args: |
${{ env.BUILD_ARGS }} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
uses: actions/[email protected]

- name: 🚀 Run Home Assistant Add-on Lint
uses: frenck/action-addon-linter@v2.11
uses: frenck/action-addon-linter@main
with:
path: "./${{ matrix.path }}"
7 changes: 7 additions & 0 deletions awnet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [1.1.1] - 2024-03-30

### Changed

- Update logging format to include file name and line number for easier troubleshooting; update format for readability.
- Update logger for WSGI to use the built-in Python logger (and not log out to stderr, thanks @jruby411!).

## [1.1.0] - 2024-01-27

### Changed
Expand Down
2 changes: 1 addition & 1 deletion awnet/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: AWNET to HASS
version: 1.1.0
version: 1.1.1
slug: awnet_to_hass
description: Addon to capture local Ambient Weather data in Home Assistant
arch:
Expand Down
6 changes: 5 additions & 1 deletion awnet/rootfs/awnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ def parse_request(self):
_LOGGER.debug("new raw_requestline: %s", self.raw_requestline)
return super().parse_request()

# Use the built-in log handler rather than outputting to stderr
def log_message(self, format, *args):
_LOGGER.info(format, *args)

if __name__ == "__main__":
from wsgiref.simple_server import make_server

logging.basicConfig(stream = sys.stdout,
format = '%(asctime)s %(levelname)8s : %(message)s',
format = '[%(asctime)s] [%(levelname)-8s] %(message)s (%(filename)s:%(lineno)d)',
level = sys.argv[1])

# probably shouldn't run on port 80 but that's what I specified in the ambient weather console
Expand Down
Loading