~ubuntu-branches/ubuntu/wily/pyzmq/wily

« back to all changes in this revision

Viewing changes to zmq/log/handlers.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2013-02-24 19:23:15 UTC
  • mfrom: (1.2.1) (9 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20130224192315-qhmwp3m3ymk8r60d
Tags: 2.2.0.1-1
* New upstream release
* relicense debian packaging to LGPL-3
* update watch file to use github directly
  thanks to Bart Martens for the file
* add autopkgtests
* drop obsolete DM-Upload-Allowed
* bump standard to 3.9.4, no changes required

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
1
"""pyzmq logging handlers.
3
2
 
4
3
This mainly defines the PUBHandler object for publishing logging messages over
10
9
    >>> handler = PUBHandler('tcp://127.0.0.1:12345')
11
10
    >>> handler.root_topic = 'foo'
12
11
    >>> logger = logging.getLogger('foobar')
13
 
    >>> logger.addHandler(logging.DEBUG, handler)
 
12
    >>> logger.setLevel(logging.DEBUG)
 
13
    >>> logger.addHandler(handler)
14
14
 
15
15
After this point, all messages logged by ``logger`` will be published on the
16
16
PUB socket.
24
24
* Min RK
25
25
"""
26
26
 
27
 
#
28
 
#    Copyright (c) 2010 Min Ragan-Kelley
29
 
#
30
 
#    This file is part of pyzmq.
31
 
#
32
 
#    pyzmq is free software; you can redistribute it and/or modify it under
33
 
#    the terms of the Lesser GNU General Public License as published by
34
 
#    the Free Software Foundation; either version 3 of the License, or
35
 
#    (at your option) any later version.
36
 
#
37
 
#    pyzmq is distributed in the hope that it will be useful,
38
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
39
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
40
 
#    Lesser GNU General Public License for more details.
41
 
#
42
 
#    You should have received a copy of the Lesser GNU General Public License
43
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
44
 
#
 
27
#-----------------------------------------------------------------------------
 
28
#  Copyright (c) 2010 Brian Granger, Min Ragan-Kelley
 
29
#
 
30
#  This file is part of pyzmq
 
31
#
 
32
#  Distributed under the terms of the New BSD License.  The full license is in
 
33
#  the file COPYING.BSD, distributed as part of this software.
 
34
#-----------------------------------------------------------------------------
45
35
 
46
36
#-----------------------------------------------------------------------------
47
37
# Imports
135
125
 
136
126
        topic = '.'.encode().join(topic_list)
137
127
 
138
 
        # map str, since sometimes we get unicode, and zmq can't deal with it
139
128
        self.socket.send_multipart([topic,msg])
140
129
 
141
130