Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ignore extra junk at the beginning of lines #9

Merged
merged 1 commit into from

2 participants

@drapp

Various logging systems may prepend extra info to each line. It's easy enough

@drapp drapp Ignore extra junk at the beginning of lines
Various logging systems may prepend extra info to each line. It's easy enough
ba795db
@esedor esedor merged commit 2d63de6 into mongolab:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. @drapp

    Ignore extra junk at the beginning of lines

    drapp authored
    Various logging systems may prepend extra info to each line. It's easy enough
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 dex/dex.py
View
8 dex/dex.py
@@ -777,7 +777,7 @@ class StandardQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'Standard Query Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += '(?P<operation>\S+) (?P<ns>\S+\.\S+) query: '
self._regex += '(?P<query>\{.*\}) (?P<options>(\S+ )*)'
self._regex += '(?P<query_time>\d+)ms'
@@ -807,7 +807,7 @@ class CmdQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'CMD Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += 'command (?P<db>\S+)\.\$cmd command: '
self._regex += '(?P<query>\{.*\}) (?P<options>(\S+ )*)'
self._regex += '(?P<query_time>\d+)ms'
@@ -842,7 +842,7 @@ class UpdateQueryHandler(QueryLineHandler):
########################################################################
def __init__(self):
self.name = 'Update Log Line Handler'
- self._regex = '.{20}\[conn(?P<connection_id>\d+)\] '
+ self._regex = '.*\[conn(?P<connection_id>\d+)\] '
self._regex += 'update (?P<ns>\S+\.\S+) query: '
self._regex += '(?P<query>\{.*\}) update: (?P<update>\{.*\}) '
self._regex += '(?P<options>(\S+ )*)(?P<query_time>\d+)ms'
@@ -1027,4 +1027,4 @@ def construct_mapping(self, node, deep=False):
node.start_mark, 'found unacceptable key (%s)' % exc, key_node.start_mark)
value = self.construct_object(value_node, deep=deep)
mapping[key] = value
- return mapping
+ return mapping
Something went wrong with that request. Please try again.