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

Log old python #54

Merged
merged 6 commits into from Oct 14, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

separate out function to log string

  • Loading branch information
Mike Blume
Mike Blume committed Oct 10, 2013
commit 6794eb78a7d0d241ee60538d7323bc873c598b42
@@ -1199,16 +1199,16 @@ def log(d, prio = 'info', facility = 'local0'):
Send a log message to Loggly;
send a UDP datagram to Loggly rather than risk blocking.
"""
msg_dict = {"version": OUR_VERSION}
msg_dict.update(d)
log_msg(json.dumps(msg_dict))

def log_msg(msg, prio='info', facility='local0'):
global _LOG_SOCKET
try:
pri = LOG_PRIORITIES[prio] + LOG_FACILITIES[facility]
except KeyError, errmsg:
pass

msg_dict = {"version": OUR_VERSION}
msg_dict.update(d)

vals = {
'pri': pri,
'version': 1,
@@ -1219,7 +1219,7 @@ def log(d, prio = 'info', facility = 'local0'):
'msgid': '-',
'loggly-auth-token': LOGGLY_AUTH_TOKEN,
'loggly-pen': int(DISTRIBUTION_ID),
'msg': json.dumps(msg_dict)
'msg': msg
}

fullmsg = ("<%(pri)s>%(version)s %(timestamp)s %(hostname)s "
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.