2
#-----------------------------------------------------------------------------
3
# Copyright (C) 2011 Brian Granger, Min Ragan-Kelley
5
# This file is part of pyzmq, copied and adapted from h5py.
6
# h5py source used under the New BSD license
8
# h5py: <http://code.google.com/p/h5py/>
10
# Distributed under the terms of the New BSD License. The full license is in
11
# the file COPYING.BSD, distributed as part of this software.
12
#-----------------------------------------------------------------------------
14
from __future__ import division
19
#-----------------------------------------------------------------------------
20
# Logging (adapted from h5py: http://h5py.googlecode.com)
21
#-----------------------------------------------------------------------------
24
logger = logging.getLogger()
25
logger.setLevel(logging.INFO)
26
logger.addHandler(logging.StreamHandler(sys.stderr))
34
def fatal(msg, code=1):
35
logger.error("Fatal: " + msg)
39
logger.error("Warning: " + msg)
41
def line(c='*', width=48):
42
print(c * (width // len(c)))