Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Trigger Distribution
Commits
5f841531
Commit
5f841531
authored
Jul 12, 2019
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sw] [tools] add option to enable logging to wrtd-logging
parent
23e22cb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
usage_tools.rst
doc/usage_tools.rst
+2
-6
wrtd-logging.py
software/tools/wrtd-logging.py
+8
-1
No files found.
doc/usage_tools.rst
View file @
5f841531
...
...
@@ -129,11 +129,7 @@ A list of the available options can be retrieved by passing the ``-h`` option to
-D DEV, --dev-id DEV MockTurtle device ID (integer) to open
-c COUNT, --count COUNT
Number of entries to read (0 = infinite)
-e, --enable Enable event logging on the Node if not already
enabled.
Log entries are printed using the format presented in :cpp:func:`wrtd_get_next_event_log_entry`.
.. hint::
Remember to enable logging first, by setting the :c:macro:`WRTD_ATTR_EVENT_LOG_ENABLED`
:ref:`attribute` to ``TRUE``. An easy way to achieve this is to use the ``set-log`` command of
:ref:`wrtd_config`.
software/tools/wrtd-logging.py
View file @
5f841531
...
...
@@ -12,7 +12,7 @@ import argparse
from
PyWrtd
import
*
def
signal_handler
(
sig
,
frame
):
sys
.
exit
(
0
)
sys
.
exit
(
0
)
def
print_logging
(
wrtd
,
count
):
n_read
=
0
...
...
@@ -31,6 +31,8 @@ def main():
help
=
'MockTurtle device ID (integer) to open'
)
parser
.
add_argument
(
'-c'
,
'--count'
,
dest
=
'count'
,
type
=
int
,
default
=
0
,
help
=
'Number of entries to read (0 = infinite)'
)
parser
.
add_argument
(
'-e'
,
'--enable'
,
action
=
'store_true'
,
help
=
'Enable event logging on the Node if not already enabled.'
)
args
=
parser
.
parse_args
()
...
...
@@ -38,6 +40,11 @@ def main():
wrtd
=
PyWrtd
(
dev
)
if
(
args
.
enable
):
wrtd
.
set_attr_bool
(
PyWrtd
.
WRTD_GLOBAL_REP_CAP_ID
,
PyWrtd
.
WRTD_ATTR_EVENT_LOG_ENABLED
,
True
)
print_logging
(
wrtd
,
args
.
count
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment