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

Add ability to tag logs through HTTP handler #8

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Update handlers.py

  • Loading branch information
bustinstuff committed Jun 10, 2014
commit 4aac3bf5aa2b88a37cd8dc57b80cb80c7cd5ed49
@@ -12,7 +12,7 @@

class LogglyHttpHandler(logging.Handler):
def __init__(self, session=None, token='', inputname='', input=None,
announce=False, json_class=None, secure=True, proxy=None):
announce=False, json_class=None, secure=True, proxy=None, tag=None):
logging.Handler.__init__(self)
if inputname:
# TODO: raise something appropriate if session is None
@@ -28,7 +28,7 @@ def __init__(self, session=None, token='', inputname='', input=None,
self.token = token
protocol = secure and 'https' or 'http'
proxy = proxy or session.proxy
self.endpoint = "%s://%s/inputs/%s" % (protocol, proxy, token)
self.endpoint = "%s://%s/inputs/%s/tag/%s" % (protocol, proxy, token, tag)
self.json_class = json_class
# TODO: verify we can write to the input
if announce:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.