[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-taler-util] 25/51: 4453. Parsing line interval.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-taler-util] 25/51: 4453. Parsing line interval. |
Date: |
Mon, 23 Sep 2019 22:02:16 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository taler-util.
commit 6eda1f9ad6fe894d2d47b89cf534c1cba9f9e3cc
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 6 18:52:42 2019 +0100
4453. Parsing line interval.
---
python/log/gnunet_log.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/python/log/gnunet_log.py b/python/log/gnunet_log.py
index ca8e598..748fb82 100755
--- a/python/log/gnunet_log.py
+++ b/python/log/gnunet_log.py
@@ -9,14 +9,25 @@ import datetime
import inspect
class LogDefinition:
- def __init__(self, component, filename, function, loglevel, forced):
+ def __init__(self, component, filename, function, line_interval, loglevel,
forced):
self.forced = forced
self.component = ".*" if "" == component else component
self.filename = ".*" if "" == filename else filename
self.function = ".*" if "" == function else function
- # string here, comes from env after all.
+ self.line_interval = self.__parse_line_interval(line_interval)
+
+ # string here
self.loglevel = loglevel
+ def __parse_line_interval(self, line_interval):
+ interval_re = "^([0-9]+)(-([0-9]+))?$"
+ match = re.match(interval_re, line_interval)
+ if match:
+ return dict(min=match.group(1), max=match.group(3))
+
+ # just match every line if bad interval was provided.
+ return dict(min=0, max=float("inf"))
+
class GnunetLoglevel:
def __init__(self, string, level, function):
self.string = string
@@ -37,7 +48,7 @@ class GnunetLogger:
COMPONENT_IDX = 0
FILENAME_IDX = 1
FUNCTION_IDX = 2
- # From line [-to line] missing.
+ LINE_INTERVAL = 3
LEVEL_IDX = 4
def __init__(self, component):
@@ -153,6 +164,7 @@ class GnunetLogger:
definition =
LogDefinition(gfl_split_split[GnunetLogger.COMPONENT_IDX],
gfl_split_split[GnunetLogger.FILENAME_IDX],
gfl_split_split[GnunetLogger.FUNCTION_IDX],
+
gfl_split_split[GnunetLogger.LINE_INTERVAL],
gfl_split_split[GnunetLogger.LEVEL_IDX],
forced)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [taler-taler-util] 09/51: empty module, (continued)
- [GNUnet-SVN] [taler-taler-util] 09/51: empty module, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 03/51: amount version 0.1. Basically has some new exceptions, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 10/51: Very first draft for solving #4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 05/51: First commit for #4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 02/51: adding amount lib, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 04/51: add talerconfig and linted amount, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 06/51: remove old config, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 07/51: Update "config" module (with one that implements @INLINE@)., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 14/51: log test, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 12/51: make map static, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 25/51: 4453. Parsing line interval.,
gnunet <=
- [GNUnet-SVN] [taler-taler-util] 11/51: Towards a usable solution for #4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 13/51: Give loglevels dedicate class + test., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 16/51: Updating Amount from bank., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 19/51: Parsing GNUNET_FORCE_LOGFILE., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 26/51: 4453. Check against further fields (filename, func, lineno), gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 17/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 24/51: fix filename extraction., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 18/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 20/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 22/51: 4453, use regex., gnunet, 2019/09/23