2 NEPI, a framework to manage network experiments
3 Copyright (C) 2013 INRIA
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 def __init__(self, logger_component):
25 self._logger = logging.getLogger(logger_component)
27 def debug(self, msg, out = None, err = None):
28 self.log(msg, logging.DEBUG, out, err)
30 def error(self, msg, out = None, err = None):
31 self.log(msg, logging.ERROR, out, err)
33 def warn(self, msg, out = None, err = None):
34 self.log(msg, logging.WARNING, out, err)
36 def info(self, msg, out = None, err = None):
37 self.log(msg, logging.INFO, out, err)
39 def log(self, msg, level, out = None, err = None):
41 msg += " - OUT: %s " % out
44 msg += " - ERROR: %s " % err
46 msg = self.log_message(msg)
48 self.logger.log(level, msg)
50 def log_message(self, msg):