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

Allows custom message and date format. #4

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

Conversation

didip
Copy link

@didip didip commented Jul 30, 2014

This PR also sets default syslog endpoint values to: udp:localhost:514. Ref: #2

Didip Kerabat added 4 commits July 30, 2014 11:32
def message_format(self):
fmt = os.environ.get(
'SYSLOG_MESSAGE_FORMAT',
self.__class__.DFLT_MSG_FORMAT
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not self.DFLT_MSG_FORMAT (here and below)?

Copy link
Author

Choose a reason for hiding this comment

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

Log routers such as Heka or Logstash are picky about which syslog RFC it is accepting.
So I figured why not let user defines which format they want through os.environ[SYSLOG_MESSAGE_FORMAT]

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the reason; I'm just saying you shouldn't use .__class__ here.

Copy link
Author

Choose a reason for hiding this comment

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

Would that work? message_format is an instance method and DEFAULT_MESSAGE_FORMAT is class variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it will.

@koterpillar
Copy link
Contributor

  • Please have a look at the Pylint messages.
  • A test for the date format would be nice.

@didip
Copy link
Author

didip commented Jul 31, 2014

@koterpillar Looks like Travis is not pointing at the right Git repo.

@koterpillar
Copy link
Contributor

It is correctly merging refs/pull/4/merge, which is this pull request.

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