1 # Copyright (C) 2015 - Philippe Proulx <pproulx@efficios.com>
2 # Copyright (C) 2014 - David Goulet <dgoulet@efficios.com>
4 # This library is free software; you can redistribute it and/or modify it under
5 # the terms of the GNU Lesser General Public License as published by the Free
6 # Software Foundation; version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 # You should have received a copy of the GNU Lesser General Public License
14 # along with this library; if not, write to the Free Software Foundation, Inc.,
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 from __future__
import unicode_literals
, print_function
24 print(msg
, file=sys
.stderr
)
30 except (ImportError) as e
:
31 _perror('lttngust package not found: {}'.format(e
))
35 ev1
= logging
.getLogger('python-ev-test1');
36 ev2
= logging
.getLogger('python-ev-test2');
41 nr_iter
= int(sys
.argv
[1])
42 wait_time
= float(sys
.argv
[2])
44 fire_second_ev
= False
45 except (IndexError) as e
:
46 _perror('missing arguments: {}'.format(e
))
47 except (ValueError) as e
:
48 _perror('invalid arguments: {}'.format(e
))
52 fire_debug_ev
= int(sys
.argv
[3])
54 fire_second_ev
= int(sys
.argv
[4])
55 except (ValueError) as e
:
56 _perror('invalid arguments: {}'.format(e
))
58 for i
in range(nr_iter
):
59 ev1
.info('{} fired [INFO]'.format(ev1
.name
))
62 ev1
.debug('{} fired [DEBUG]'.format(ev1
.name
))
67 ev2
.info('{} fired [INFO]'.format(ev2
.name
))
70 if __name__
== '__main__':
This page took 0.030498 seconds and 4 git commands to generate.