On Sun, Jul 6, 2014 at 3:13 AM, Dylan Baker <[email protected]> wrote: > This adds a new logger option that produces no output. This is aimed at > headless setups or for systems like jenkins where the output data isn't > very useful. > > Signed-off-by: Dylan Baker <[email protected]> > --- > framework/log.py | 13 +++++++++++++ > framework/tests/log_tests.py | 3 ++- > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/framework/log.py b/framework/log.py > index 9b9805f..c394c3c 100644 > --- a/framework/log.py > +++ b/framework/log.py > @@ -219,6 +219,18 @@ class VerboseLog(QuietLog): > super(VerboseLog, self).log(value) > > > +class DummyLog(BaseLog): > + """ A Logger that does nothing """ > + def start(self, name): > + pass > + > + def log(self, status): > + pass > + > + def summary(self): > + pass > + > + > class LogManager(object): > """ Creates new log objects > > @@ -240,6 +252,7 @@ class LogManager(object): > LOG_MAP = { > 'quiet': QuietLog, > 'verbose': VerboseLog, > + 'dummy': DummyLog,
IMHO 'none' makes more sense here than 'dummy' Either way, Reviewed-by: Ilia Mirkin <[email protected]> > } > > def __init__(self, logger, total): > diff --git a/framework/tests/log_tests.py b/framework/tests/log_tests.py > index a71f3ca..9703b11 100644 > --- a/framework/tests/log_tests.py > +++ b/framework/tests/log_tests.py > @@ -37,7 +37,8 @@ def test_initialize(): > check_initialize = lambda c, *a: c(*a) > > for name, class_ in [('QuiteLog', log.QuietLog), > - ('VerboseLog', log.VerboseLog)]: > + ('VerboseLog', log.VerboseLog), > + ('DummyLog', log.DummyLog)]: > check_initialize.description = "{} initializes".format(name) > yield check_initialize, class_, TEST_STATE > > -- > 2.0.0 > > _______________________________________________ > Piglit mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/piglit _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
