]> SALOME platform Git repositories - modules/adao.git/blob - src/daSalome/daGUI/daUtils/adaoLogger.py
Salome HOME
5dcf95194ced2da70738cf0a83809f8a0d8dde9b
[modules/adao.git] / src / daSalome / daGUI / daUtils / adaoLogger.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2008-2015 EDF R&D
3 #
4 # This file is part of SALOME ADAO module
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 from salome.kernel.logger import Logger
24 from salome.kernel import termcolor
25
26 adao_logger = Logger("ADAO")
27 adao_engine_logger = Logger("ADAO ENGINE")
28
29 def info(msg, logger = "ADAO"):
30
31   if logger == "ADAO":
32     adao_logger.setColor(termcolor.BLUE)
33     adao_logger.info(msg)
34   elif logger == "ENGINE":
35     adao_engine_logger.setColor(termcolor.BLUE)
36     adao_engine_logger.info(msg)
37
38 def debug(msg, logger = "ADAO"):
39
40   if logger == "ADAO":
41     adao_logger.setColor(termcolor.GREEN)
42     adao_logger.debug(msg)
43   elif logger == "ENGINE":
44     adao_engine_logger.setColor(termcolor.GREEN)
45     adao_engine_logger.debug(msg)
46
47 def error(msg, logger = "ADAO"):
48
49   if logger == "ADAO":
50     adao_logger.setColor(termcolor.RED)
51     adao_logger.error(msg)
52   elif logger == "ENGINE":
53     adao_engine_logger.setColor(termcolor.RED)
54     adao_engine_logger.error(msg)
55
56 def warning(msg, logger = "ADAO"):
57
58   if logger == "ADAO":
59     adao_logger.setColor(termcolor.CYAN)
60     adao_logger.warning(msg)
61   elif logger == "ENGINE":
62     adao_engine_logger.setColor(termcolor.CYAN)
63     adao_engine_logger.warning(msg)