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

feat: Syslog wrapper #201

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

feat: Syslog wrapper #201

wants to merge 7 commits into from

Conversation

devmaxde
Copy link
Contributor

Introducing the @metricq_syslog() wrapper for click commands, that configures the logger to sent to a Syslog Location (local or remote)

@devmaxde devmaxde changed the title Feat syslog feat: Syslog wrapper Oct 29, 2024
@devmaxde devmaxde force-pushed the feat_syslog branch 5 times, most recently from ccc4a3b to 5ce43fe Compare November 5, 2024 13:56
return syslog_header + message


def get_syslog_handler(address: str) -> SysLogHandler:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_syslog_handler(address: str) -> SysLogHandler:
def get_syslog_handler(address: str | None) -> SysLogHandler:

metricq/cli/wrapper.py Outdated Show resolved Hide resolved
metricq/cli/wrapper.py Outdated Show resolved Hide resolved
if value is not None:
logger = get_logger()

program_name: str = "metricq_program"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metricq_program is worse than the actual default, which is the process name.

metricq/cli/wrapper.py Outdated Show resolved Hide resolved

return option(
"--syslog",
help="Enable syslog logging by specifying the syslog path or URL for the logger.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intended format is not a URL. A URL contains a scheme, but a hostname-port tuple does not. The path is a UNIX domain socket.

@devmaxde devmaxde force-pushed the feat_syslog branch 2 times, most recently from 4a81244 to 8168afe Compare November 12, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants