[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [nyx/master] Mappings for new event types
commit 047ec0b90080ac487390ff80d604f8908ad438f1
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sun Jan 31 13:17:55 2016 -0800
Mappings for new event types
Nyx uses a shorthand for events where you can list them with one character
each. For instance, 'nyx -e Db' would log BW events along with DEBUG and above.
Naturally tor's added quite a few event types in the last few years, causing
the following warning...
01/31/2016 13:00:07 [INFO] nyx doesn't recognize the following event types:
CIRC_MINOR, SIGNAL, CONF_CHANGED, CONN_BW, CELL_STATS, TB_EMPTY, CIRC_BW,
TRANSPORT_LAUNCHED, HS_DESC, HS_DESC_CONTENT, NETWORK_LIVENESS (log 'UNKNOWN'
events to see them)
We now have so many that we need to use capital letters for many of these.
Honestly this shorthand approach kinda sucks. It's handy for common event types
like runlevels, but for anything else you need to check the mappings.
I might change this in a future release but for now just adding the missing
mappings.
---
nyx/arguments.py | 46 ++++++++++++++++++++++++++++++++--------------
nyx/config/strings.cfg | 21 ++++++++++++++-------
nyx/log_panel.py | 2 +-
3 files changed, 47 insertions(+), 22 deletions(-)
diff --git a/nyx/arguments.py b/nyx/arguments.py
index 7510057..01c2095 100644
--- a/nyx/arguments.py
+++ b/nyx/arguments.py
@@ -38,29 +38,47 @@ OPT_EXPANDED = [
]
TOR_EVENT_TYPES = {
+ # runlevels
+
'd': 'DEBUG',
'i': 'INFO',
'n': 'NOTICE',
'w': 'WARN',
'e': 'ERR',
- 'a': 'ADDRMAP',
- 'f': 'AUTHDIR_NEWDESCS',
- 'h': 'BUILDTIMEOUT_SET',
+ # important events
+
'b': 'BW',
'c': 'CIRC',
- 'j': 'CLIENTS_SEEN',
- 'k': 'DESCCHANGED',
- 'g': 'GUARD',
- 'l': 'NEWCONSENSUS',
- 'm': 'NEWDESC',
- 'p': 'NS',
- 'q': 'ORCONN',
's': 'STREAM',
- 'r': 'STREAM_BW',
- 't': 'STATUS_CLIENT',
- 'u': 'STATUS_GENERAL',
- 'v': 'STATUS_SERVER',
+
+ # everything else
+
+ 'a': 'ADDRMAP',
+ 'f': 'AUTHDIR_NEWDESCS',
+ 'j': 'BUILDTIMEOUT_SET',
+ 'k': 'CELL_STATS',
+ 'l': 'CIRC_BW',
+ 'm': 'CIRC_MINOR',
+ 'p': 'CONF_CHANGED',
+ 'q': 'CONN_BW',
+ 'r': 'CLIENTS_SEEN',
+ 'u': 'DESCCHANGED',
+ 'g': 'GUARD',
+ 'h': 'HS_DESC',
+ 'v': 'HS_DESC_CONTENT',
+ 'x': 'NETWORK_LIVENESS',
+ 'y': 'NEWCONSENSUS',
+ 'z': 'NEWDESC',
+ 'B': 'NS',
+ 'o': 'ORCONN',
+ 'C': 'SIGNAL',
+ 'F': 'STREAM_BW',
+ 'G': 'STATUS_CLIENT',
+ 'H': 'STATUS_GENERAL',
+ 'I': 'STATUS_SERVER',
+ 'J': 'TB_EMPTY',
+ 't': 'TRANSPORT_LAUNCHED',
}
diff --git a/nyx/config/strings.cfg b/nyx/config/strings.cfg
index 9cd217f..85b4f8d 100644
--- a/nyx/config/strings.cfg
+++ b/nyx/config/strings.cfg
@@ -60,14 +60,19 @@ msg.debug.header
|--------------------------------------------------------------------------------
msg.misc.event_types
-| d DEBUG a ADDRMAP k DESCCHANGED s STREAM
-| i INFO f AUTHDIR_NEWDESCS g GUARD r STREAM_BW
-| n NOTICE h BUILDTIMEOUT_SET l NEWCONSENSUS t STATUS_CLIENT
-| w WARN b BW m NEWDESC u STATUS_GENERAL
-| e ERR c CIRC p NS v STATUS_SERVER
-| j CLIENTS_SEEN q ORCONN
+| d DEBUG a ADDRMAP r CLIENTS_SEEN C SIGNAL
+| i INFO f AUTHDIR_NEWDESCS u DESCCHANGED F STREAM_BW
+| n NOTICE j BUILDTIMEOUT_SET g GUARD G STATUS_CLIENT
+| w WARN b BW h HS_DESC H STATUS_GENERAL
+| e ERR k CELL_STATS v HS_DESC_CONTENT I STATUS_SERVER
+| c CIRC x NETWORK_LIVENESS s STREAM
+| l CIRC_BW y NEWCONSENSUS J TB_EMPTY
+| m CIRC_MINOR z NEWDESC t TRANSPORT_LAUNCHED
+| p CONF_CHANGED B NS
+| q CONN_BW o ORCONN
+|
| DINWE tor runlevel+ A All Events
-| 12345 nyx runlevel+ X No Events
+| 12345 nyx runlevel+ X No Events
| U Unknown Events
msg.setup.unknown_term
@@ -86,7 +91,9 @@ msg.usage.help_output
| defaults to: {config_path}
| -d, --debug LOG_PATH writes all nyx logs to the given location
| -l, --log EVENT_FLAGS event types to be logged (default: {events})
+|
|{event_flags}
+|
| -v, --version provides version information
| -h, --help presents this help
|
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index dedfc99..e97d74b 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -140,7 +140,7 @@ class LogPanel(panel.Panel, threading.Thread):
# allow user to enter new types of events to log - unchanged if left blank
- with nyx.popups.popup_window(11, 80) as (popup, width, height):
+ with nyx.popups.popup_window(16, 80) as (popup, width, height):
if popup:
# displays the available flags
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits