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