targets/typemapping.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 17 Aug 2017 10:12:04 +0300
changeset 1761 8c98bad90b8d
parent 1758 845ca626db09
child 1767 c74815729afd
permissions -rw-r--r--
clean-up: fix PEP8 E203 whitespace before ','
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
     1
#!/usr/bin/env python
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
1571
486f94a8032c fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1433
diff changeset
     3
1667
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
     4
# This file is part of Beremiz, runtime and an Integrated Development Environment for
1571
486f94a8032c fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1433
diff changeset
     5
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
     6
#
1571
486f94a8032c fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1433
diff changeset
     7
# Copyright (C) 2011: Edouard TISSERANT and Laurent BESSARD
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
     8
#
1667
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
     9
# See COPYING.Runtime file for copyrights details.
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    10
#
1667
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    11
# This library is free software; you can redistribute it and/or
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    12
# modify it under the terms of the GNU Lesser General Public
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    13
# License as published by the Free Software Foundation; either
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    14
# version 2.1 of the License, or (at your option) any later version.
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    15
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    16
# This library is distributed in the hope that it will be useful,
1571
486f94a8032c fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1433
diff changeset
    17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1667
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    19
# Lesser General Public License for more details.
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    20
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    21
# You should have received a copy of the GNU Lesser General Public
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    22
# License along with this library; if not, write to the Free Software
cefc9219bb48 runtime is licensed under LGPLv2.1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1571
diff changeset
    23
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    24
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    25
import ctypes
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    26
ctypes.pythonapi.PyString_AsString.argtypes = (ctypes.c_void_p,)
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    27
ctypes.pythonapi.PyString_AsString.restype = ctypes.POINTER(ctypes.c_char)
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    28
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    29
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    30
from ctypes import *
593
726f58cf97e3 fixed typo in latest debugger changes
edouard
parents: 592
diff changeset
    31
from datetime import timedelta as td
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    32
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    33
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    34
class IEC_STRING(Structure):
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    35
    """
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    36
    Must be changed according to changes in iec_types.h
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    37
    """
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    38
    _fields_ = [("len", c_uint8),
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    39
                ("body", c_char * 126)]
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    40
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    41
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    42
class IEC_TIME(Structure):
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    43
    """
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    44
    Must be changed according to changes in iec_types.h
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    45
    """
1737
a39c2918c015 clean-up: fix PEP8 E261 at least two spaces before inline comment
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    46
    _fields_ = [("s", c_long),   # tv_sec
a39c2918c015 clean-up: fix PEP8 E261 at least two spaces before inline comment
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    47
                ("ns", c_long)]  # tv_nsec
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    48
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    49
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    50
def _t(t, u=lambda x: x.value, p=lambda t, x: t(x)): return (t, u, p)
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    51
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    52
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    53
def _ttime(): return (IEC_TIME,
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    54
                      lambda x: td(0, x.s, x.ns/1000),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    55
                      lambda t, x: t(x.days * 24 * 3600 + x.seconds, x.microseconds*1000))
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    56
1749
d73b64672238 clean-up: fix PEP8 E305 expected 2 blank lines after class or function definition
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1748
diff changeset
    57
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    58
SameEndianessTypeTranslator = {
1742
92932cd370a4 clean-up: fix PEP8 E225 missing whitespace around operator
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1741
diff changeset
    59
    "BOOL":       _t(c_uint8,  lambda x: x.value != 0),
1739
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    60
    "STEP":       _t(c_uint8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    61
    "TRANSITION": _t(c_uint8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    62
    "ACTION":     _t(c_uint8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    63
    "SINT":       _t(c_int8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    64
    "USINT":      _t(c_uint8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    65
    "BYTE":       _t(c_uint8),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    66
    "STRING":     (IEC_STRING,
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    67
                   lambda x: x.body[:x.len],
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    68
                   lambda t, x: t(len(x), x)),
1739
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    69
    "INT":        _t(c_int16),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    70
    "UINT":       _t(c_uint16),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    71
    "WORD":       _t(c_uint16),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    72
    "DINT":       _t(c_int32),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    73
    "UDINT":      _t(c_uint32),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    74
    "DWORD":      _t(c_uint32),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    75
    "LINT":       _t(c_int64),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    76
    "ULINT":      _t(c_uint64),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    77
    "LWORD":      _t(c_uint64),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    78
    "REAL":       _t(c_float),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    79
    "LREAL":      _t(c_double),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    80
    "TIME":       _ttime(),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    81
    "TOD":        _ttime(),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    82
    "DATE":       _ttime(),
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1738
diff changeset
    83
    "DT":         _ttime(),
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    84
    }
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    85
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    86
SwapedEndianessTypeTranslator = {
1733
dea107dce0c4 clean-up: fix some PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1667
diff changeset
    87
    # TODO
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    88
    }
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    89
1742
92932cd370a4 clean-up: fix PEP8 E225 missing whitespace around operator
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1741
diff changeset
    90
TypeTranslator = SameEndianessTypeTranslator
1075
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
    91
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    92
# Construct debugger natively supported types
1758
845ca626db09 clean-up: fix PEP8 E222 multiple spaces after operator
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1749
diff changeset
    93
DebugTypesSize = dict([(key, sizeof(t)) for key, (t, p, u) in SameEndianessTypeTranslator.iteritems() if t is not None])
592
c6408f92da0a Initial TIME support in debugger
Edouard Tisserant
parents:
diff changeset
    94
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1733
diff changeset
    95
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    96
def UnpackDebugBuffer(buff, indexes):
1758
845ca626db09 clean-up: fix PEP8 E222 multiple spaces after operator
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1749
diff changeset
    97
    res = []
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    98
    buffoffset = 0
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
    99
    buffsize = len(buff)
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   100
    buffptr = cast(ctypes.pythonapi.PyString_AsString(id(buff)), c_void_p).value
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   101
    for iectype in indexes:
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   102
        c_type, unpack_func, pack_func = \
1075
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   103
            TypeTranslator.get(iectype,
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   104
                                    (None, None, None))
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   105
        if c_type is not None and buffoffset < buffsize:
1747
6046ffa2280f clean-up: fix PEP8 E201 whitespace after '{'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1742
diff changeset
   106
            cursor = c_void_p(buffptr + buffoffset)
6046ffa2280f clean-up: fix PEP8 E201 whitespace after '{'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1742
diff changeset
   107
            value = unpack_func(cast(cursor,
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   108
                         POINTER(c_type)).contents)
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   109
            buffoffset += sizeof(c_type) if iectype != "STRING" else len(value)+1
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   110
            res.append(value)
1075
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   111
        else:
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   112
            break
1433
4a45f6642523 Moved trace buffer unpacking in the IDE. Latest traced variable samples are now passed as a single string
Edouard Tisserant
parents: 1075
diff changeset
   113
    if buffoffset and buffoffset == buffsize:
1075
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   114
        return res
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   115
    return None
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   116
8078c01ae464 Now Debug Buffer Unpacking is a separate function, declared in typemapping.py
Edouard Tisserant
parents: 972
diff changeset
   117
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   118
LogLevels = ["CRITICAL", "WARNING", "INFO", "DEBUG"]
917
401e44bae7c0 Now logging have 4 levels
Edouard Tisserant
parents: 595
diff changeset
   119
LogLevelsCount = len(LogLevels)
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   120
LogLevelsDict = dict(zip(LogLevels, range(LogLevelsCount)))
917
401e44bae7c0 Now logging have 4 levels
Edouard Tisserant
parents: 595
diff changeset
   121
LogLevelsDefault = LogLevelsDict["DEBUG"]