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

Cleanups #4

Merged
merged 4 commits into from Aug 20, 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

just use a dict literal

  • Loading branch information
Mike Blume
Mike Blume committed Aug 20, 2013
commit b41d730e922fe9bfadfba0168b713c19ed78743f
@@ -1167,17 +1167,18 @@ def log(msg, prio = 'info', facility = 'local0'):
except KeyError as errmsg:
pass

vals = {}
vals['pri'] = pri
vals['version'] = 1
vals['timestamp'] = datetime.isoformat(datetime.now())
vals['hostname'] = socket.gethostname()
vals['app-name'] = OUR_PROGNAME
vals['procid'] = os.getpid()
vals['msgid'] = '-'
vals['loggly-auth-token'] = LOGGLY_AUTH_TOKEN
vals['loggly-pen'] = int(DISTRIBUTION_ID)
vals['msg'] = msg
vals = {
'pri': pri,
'version': 1,
'timestamp': datetime.isoformat(datetime.now()),
'hostname': socket.gethostname(),
'app-name': OUR_PROGNAME,
'procid': os.getpid(),
'msgid': '-',
'loggly-auth-token': LOGGLY_AUTH_TOKEN,
'loggly-pen': int(DISTRIBUTION_ID),
'msg': msg,
}

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