diff options
author | Dan Klein <danklei@cisco.com> | 2015-08-24 13:22:48 +0300 |
---|---|---|
committer | Dan Klein <danklei@cisco.com> | 2015-08-24 13:22:48 +0300 |
commit | dab741a80699f86e86c91718872a052cca9bbb25 (patch) | |
tree | 1959c4a2cea440170a5113dcb067796cb20ffb64 /external_libs/python/pyzmq-14.7.0/buildutils/msg.py | |
parent | d3f26ece7d4383df0b22fe9c3cb3e695381ec737 (diff) |
Fixed dependencies of Control Plane to use external_lib sources
Diffstat (limited to 'external_libs/python/pyzmq-14.7.0/buildutils/msg.py')
-rw-r--r-- | external_libs/python/pyzmq-14.7.0/buildutils/msg.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/external_libs/python/pyzmq-14.7.0/buildutils/msg.py b/external_libs/python/pyzmq-14.7.0/buildutils/msg.py new file mode 100644 index 00000000..70cd7166 --- /dev/null +++ b/external_libs/python/pyzmq-14.7.0/buildutils/msg.py @@ -0,0 +1,39 @@ +"""logging""" + +# Copyright (c) PyZMQ Developers. +# Distributed under the terms of the Modified BSD License. + +from __future__ import division + +import os +import sys +import logging + +#----------------------------------------------------------------------------- +# Logging (adapted from h5py: http://h5py.googlecode.com) +#----------------------------------------------------------------------------- + + +logger = logging.getLogger() +if os.environ.get('DEBUG'): + logger.setLevel(logging.DEBUG) +else: + logger.setLevel(logging.INFO) +logger.addHandler(logging.StreamHandler(sys.stderr)) + +def debug(msg): + logger.debug(msg) + +def info(msg): + logger.info(msg) + +def fatal(msg, code=1): + logger.error("Fatal: " + msg) + exit(code) + +def warn(msg): + logger.error("Warning: " + msg) + +def line(c='*', width=48): + print(c * (width // len(c))) + |