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 all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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=''):
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.