From 31f744e7567dcd20aea9e59dc9f4023bc920b949 Mon Sep 17 00:00:00 2001 From: DEBREUVE Eric <eric.debreuve@cnrs.fr> Date: Tue, 2 Jul 2024 19:30:45 +0200 Subject: [PATCH] added LOGGERS, added exception logging, refactoring --- MANIFEST.in | 1 - README-COPYRIGHT-utf8.txt | 36 +++++- README-api-documentation.rst | 5 - README.rst | 76 +++++++----- logger_36/__init__.py | 86 +++++++++----- logger_36/catalog/config/console_rich.py | 95 +++++++++------ logger_36/catalog/handler/README.txt | 31 ----- logger_36/catalog/handler/console.py | 106 ++++++++++------- logger_36/catalog/handler/console_rich.py | 112 +++++++++++------- logger_36/catalog/handler/file.py | 112 +++++++++++------- logger_36/catalog/handler/generic.py | 123 ++++++++++++-------- logger_36/catalog/logging/chronos.py | 89 ++++++++------ logger_36/catalog/logging/exception.py | 74 ++++++++++++ logger_36/catalog/logging/gpu.py | 89 ++++++++------ logger_36/catalog/logging/memory.py | 105 ++++++++++------- logger_36/catalog/logging/system.py | 88 +++++++++----- logger_36/config/issue.py | 81 ++++++++----- logger_36/config/memory.py | 81 ++++++++----- logger_36/config/message.py | 81 ++++++++----- logger_36/config/system.py | 81 ++++++++----- logger_36/constant/error.py | 81 ++++++++----- logger_36/constant/generic.py | 81 ++++++++----- logger_36/constant/handler.py | 81 ++++++++----- logger_36/constant/issue.py | 81 ++++++++----- logger_36/constant/logger.py | 81 ++++++++----- logger_36/constant/memory.py | 81 ++++++++----- logger_36/constant/message.py | 81 ++++++++----- logger_36/constant/record.py | 81 ++++++++----- logger_36/constant/system.py | 100 ++++++++++------ logger_36/instance.py | 34 ------ logger_36/instance/logger.py | 55 +++++++++ logger_36/instance/loggers.py | 56 +++++++++ logger_36/main.py | 94 +++++++++------ logger_36/task/format/memory.py | 82 ++++++++----- logger_36/task/format/message.py | 82 ++++++++----- logger_36/task/format/rule.py | 81 ++++++++----- logger_36/task/inspection.py | 82 ++++++++----- logger_36/task/measure/chronos.py | 82 ++++++++----- logger_36/task/measure/memory.py | 82 ++++++++----- logger_36/task/storage.py | 98 ++++++++++------ logger_36/type/{extension.py => handler.py} | 96 +++++++++------ logger_36/type/issue.py | 82 ++++++++----- logger_36/type/logger.py | 121 +++++++++++-------- logger_36/type/loggers.py | 78 +++++++++++++ logger_36/version.py | 85 +++++++++----- setup.py | 82 ++++++++----- test/main.py | 81 ++++++++----- 47 files changed, 2403 insertions(+), 1350 deletions(-) delete mode 100644 README-api-documentation.rst create mode 100644 logger_36/catalog/logging/exception.py delete mode 100644 logger_36/instance.py create mode 100644 logger_36/instance/logger.py create mode 100644 logger_36/instance/loggers.py rename logger_36/type/{extension.py => handler.py} (70%) create mode 100644 logger_36/type/loggers.py diff --git a/MANIFEST.in b/MANIFEST.in index df73841..181223f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ include README-COPYRIGHT-utf8.txt include README-LICENCE-utf8.txt -include requirements.txt include documentation/wiki/description.asciidoc diff --git a/README-COPYRIGHT-utf8.txt b/README-COPYRIGHT-utf8.txt index ae2d68e..ac967bf 100644 --- a/README-COPYRIGHT-utf8.txt +++ b/README-COPYRIGHT-utf8.txt @@ -1,11 +1,39 @@ Copyright CNRS/Inria/UniCA -Contributor(s): Eric Debreuve (since 2023) +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 -eric.debreuve@cnrs.fr +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". -This software is being developed by Eric Debreuve, a CNRS employee and member of team Morpheme. +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: README-LICENCE-utf8.txt + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. Team Morpheme is a joint team between Inria, CNRS, and UniCA. -It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory I3S, and Laboratory iBV. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. CNRS: https://www.cnrs.fr/index.php/en Inria: https://www.inria.fr/en/ diff --git a/README-api-documentation.rst b/README-api-documentation.rst deleted file mode 100644 index 6b32407..0000000 --- a/README-api-documentation.rst +++ /dev/null @@ -1,5 +0,0 @@ -The API documentations are automatically generated by: - -- `pdoc3 <https://pdoc3.github.io/pdoc>`_, *Auto-generate API documentation for Python projects*. - -- `pydoctor <https://github.com/twisted/pydoctor>`_, *an API documentation generator that works by static analysis*. diff --git a/README.rst b/README.rst index b991ba0..7708f5e 100644 --- a/README.rst +++ b/README.rst @@ -1,34 +1,7 @@ .. Copyright CNRS/Inria/UniCA - Contributor(s): Eric Debreuve (since 2023) - - eric.debreuve@cnrs.fr - - This software is governed by the CeCILL license under French law and - abiding by the rules of distribution of free software. You can use, - modify and/ or redistribute the software under the terms of the CeCILL - license as circulated by CEA, CNRS and INRIA at the following URL - "http://www.cecill.info". - - As a counterpart to the access to the source code and rights to copy, - modify and redistribute granted by the license, users are provided only - with a limited warranty and the software's author, the holder of the - economic rights, and the successive licensors have only limited - liability. - - In this respect, the user's attention is drawn to the risks associated - with loading, using, modifying and/or developing or reproducing the - software by the user in light of its specific status of free software, - that may mean that it is complicated to manipulate, and that also - therefore means that it is reserved for developers and experienced - professionals having in-depth computer knowledge. Users are therefore - encouraged to load and test the software's suitability as regards their - requirements in conditions enabling the security of their systems and/or - data to be ensured and, more generally, to use and operate it in the - same conditions as regards security. - - The fact that you are presently reading this means that you have had - knowledge of the CeCILL license and that you accept its terms. + Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 + SEE COPYRIGHT NOTICE BELOW .. |PROJECT_NAME| replace:: logger-36 .. |SHORT_DESCRIPTION| replace:: Simple logger with a catalog of handlers @@ -104,3 +77,48 @@ The project is developed with `PyCharm Community <https://www.jetbrains.com/pych The code is formatted by `Black <https://github.com/psf/black/>`_, *The Uncompromising Code Formatter*. The imports are ordered by `isort <https://github.com/timothycrosley/isort/>`_... *your imports, so you don't have to*. + +.. + COPYRIGHT NOTICE + + This software is governed by the CeCILL license under French law and + abiding by the rules of distribution of free software. You can use, + modify and/ or redistribute the software under the terms of the CeCILL + license as circulated by CEA, CNRS and INRIA at the following URL + "http://www.cecill.info". + + As a counterpart to the access to the source code and rights to copy, + modify and redistribute granted by the license, users are provided only + with a limited warranty and the software's author, the holder of the + economic rights, and the successive licensors have only limited + liability. + + In this respect, the user's attention is drawn to the risks associated + with loading, using, modifying and/or developing or reproducing the + software by the user in light of its specific status of free software, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + requirements in conditions enabling the security of their systems and/or + data to be ensured and, more generally, to use and operate it in the + same conditions as regards security. + + The fact that you are presently reading this means that you have had + knowledge of the CeCILL license and that you accept its terms. + + SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + + This software is being developed by Eric Debreuve, a CNRS employee and + member of team Morpheme. + Team Morpheme is a joint team between Inria, CNRS, and UniCA. + It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory + I3S, and Laboratory iBV. + + CNRS: https://www.cnrs.fr/index.php/en + Inria: https://www.inria.fr/en/ + UniCA: https://univ-cotedazur.eu/ + Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ + I3S: https://www.i3s.unice.fr/en/ + iBV: http://ibv.unice.fr/ + Team Morpheme: https://team.inria.fr/morpheme/ diff --git a/logger_36/__init__.py b/logger_36/__init__.py index d1d50c5..0cbaeaf 100644 --- a/logger_36/__init__.py +++ b/logger_36/__init__.py @@ -1,35 +1,10 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from logger_36.instance import LOGGER +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +from logger_36.instance.logger import LOGGER from logger_36.main import ( AddConsoleHandler, AddFileHandler, @@ -37,4 +12,51 @@ from logger_36.main import ( AddRichConsoleHandler, ) from logger_36.task.format.message import FormattedMessage +from logger_36.type.logger import logger_t from logger_36.version import __version__ + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/config/console_rich.py b/logger_36/catalog/config/console_rich.py index ffe1e12..974b15e 100644 --- a/logger_36/catalog/config/console_rich.py +++ b/logger_36/catalog/config/console_rich.py @@ -1,43 +1,18 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - """ -Colors: See https://rich.readthedocs.io/en/stable/appendix/colors.html. +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW """ + import logging as lggg from rich.color import Color as color_t from rich.style import Style as style_t -DATE_TIME_COLOR: str = "dodger_blue2" +""" +Colors: See https://rich.readthedocs.io/en/stable/appendix/colors.html. +""" +DATE_TIME_COLOR = "dodger_blue2" LEVEL_COLOR: dict[int, str | style_t] = { lggg.DEBUG: "orchid", lggg.INFO: "white", @@ -45,8 +20,54 @@ LEVEL_COLOR: dict[int, str | style_t] = { lggg.ERROR: "orange1", lggg.CRITICAL: "red", } -ACTUAL_COLOR: str = "indian_red" -EXPECTED_COLOR: str = "green" -ELAPSED_TIME_COLOR: str = "green" +ACTUAL_COLOR = "indian_red" +EXPECTED_COLOR = "green" +ELAPSED_TIME_COLOR = "green" + +GRAY_STYLE = style_t(color=color_t.from_rgb(150, 150, 150)) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. -GRAY_STYLE: style_t = style_t(color=color_t.from_rgb(150, 150, 150)) +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/handler/README.txt b/logger_36/catalog/handler/README.txt index 3fb8eb0..8762597 100644 --- a/logger_36/catalog/handler/README.txt +++ b/logger_36/catalog/handler/README.txt @@ -1,34 +1,3 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - --- Note concerning: def emit(self, record: lggg.LogRecord, /) -> None: The attribute "message" is not yet defined in record. It will be set by format(). Use "msg" instead. diff --git a/logger_36/catalog/handler/console.py b/logger_36/catalog/handler/console.py index 85e95a4..20a0509 100644 --- a/logger_36/catalog/handler/console.py +++ b/logger_36/catalog/handler/console.py @@ -1,54 +1,29 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import typing as h from logger_36.constant.record import SHOW_W_RULE_ATTR from logger_36.task.format.rule import RuleAsText -from logger_36.type.extension import handler_extension_t +from logger_36.type.handler import handler_extension_t -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class console_handler_t(lggg.Handler): - extension: handler_extension_t = dtcl.field(init=False) - FormattedLines: h.Callable[..., tuple[str, str | None]] = dtcl.field(init=False) + extension: handler_extension_t = d.field(init=False) + FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False) - name: dtcl.InitVar[str | None] = None - level: dtcl.InitVar[int] = lggg.NOTSET - show_where: dtcl.InitVar[bool] = True - show_memory_usage: dtcl.InitVar[bool] = False - message_width: dtcl.InitVar[int] = -1 - formatter: dtcl.InitVar[lggg.Formatter | None] = None + name: d.InitVar[str | None] = None + level: d.InitVar[int] = lggg.NOTSET + show_where: d.InitVar[bool] = True + show_memory_usage: d.InitVar[bool] = False + message_width: d.InitVar[int] = -1 + formatter: d.InitVar[lggg.Formatter | None] = None def __post_init__( self, @@ -85,3 +60,50 @@ class console_handler_t(lggg.Handler): def ShowMessage(self, message: str, /) -> None: """""" print(message) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/handler/console_rich.py b/logger_36/catalog/handler/console_rich.py index 97760f0..6036ba7 100644 --- a/logger_36/catalog/handler/console_rich.py +++ b/logger_36/catalog/handler/console_rich.py @@ -1,35 +1,10 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import typing as h @@ -51,7 +26,7 @@ from logger_36.config.message import ( from logger_36.constant.message import TIME_LENGTH from logger_36.constant.record import SHOW_W_RULE_ATTR from logger_36.task.format.rule import Rule -from logger_36.type.extension import handler_extension_t +from logger_36.type.handler import handler_extension_t from rich.console import Console as console_t from rich.console import RenderableType as renderable_t from rich.markup import escape as EscapedForRich @@ -72,21 +47,21 @@ _EXCLUSIVE_TRACEBACK_ARGUMENTS = ( ) -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class console_rich_handler_t(lggg.Handler): - extension: handler_extension_t = dtcl.field(init=False) - console: console_t = dtcl.field(init=False) - FormattedLines: h.Callable[..., tuple[str, str | None]] = dtcl.field(init=False) + extension: handler_extension_t = d.field(init=False) + console: console_t = d.field(init=False) + FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False) - name: dtcl.InitVar[str | None] = None - level: dtcl.InitVar[int] = lggg.NOTSET - show_where: dtcl.InitVar[bool] = True - show_memory_usage: dtcl.InitVar[bool] = False - message_width: dtcl.InitVar[int] = -1 - formatter: dtcl.InitVar[lggg.Formatter | None] = None - should_install_traceback: dtcl.InitVar[bool] = False + name: d.InitVar[str | None] = None + level: d.InitVar[int] = lggg.NOTSET + show_where: d.InitVar[bool] = True + show_memory_usage: d.InitVar[bool] = False + message_width: d.InitVar[int] = -1 + formatter: d.InitVar[lggg.Formatter | None] = None + should_install_traceback: d.InitVar[bool] = False - rich_kwargs: dtcl.InitVar[dict[str, h.Any] | None] = None + rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None def __post_init__( self, @@ -182,3 +157,50 @@ class console_rich_handler_t(lggg.Handler): _ = output.highlight_regex(EXPECTED_PATTERNS, style=EXPECTED_COLOR) return output + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/handler/file.py b/logger_36/catalog/handler/file.py index 98b640f..656080b 100644 --- a/logger_36/catalog/handler/file.py +++ b/logger_36/catalog/handler/file.py @@ -1,60 +1,35 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import typing as h from pathlib import Path as path_t from logger_36.constant.record import SHOW_W_RULE_ATTR from logger_36.task.format.rule import RuleAsText -from logger_36.type.extension import handler_extension_t +from logger_36.type.handler import handler_extension_t -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class file_handler_t(lggg.FileHandler): - extension: handler_extension_t = dtcl.field(init=False) - FormattedLines: h.Callable[..., tuple[str, str | None]] = dtcl.field(init=False) + extension: handler_extension_t = d.field(init=False) + FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False) - name: dtcl.InitVar[str | None] = None - level: dtcl.InitVar[int] = lggg.NOTSET - show_where: dtcl.InitVar[bool] = True - show_memory_usage: dtcl.InitVar[bool] = False - message_width: dtcl.InitVar[int] = -1 - formatter: dtcl.InitVar[lggg.Formatter | None] = None + name: d.InitVar[str | None] = None + level: d.InitVar[int] = lggg.NOTSET + show_where: d.InitVar[bool] = True + show_memory_usage: d.InitVar[bool] = False + message_width: d.InitVar[int] = -1 + formatter: d.InitVar[lggg.Formatter | None] = None - path: dtcl.InitVar[path_t | None] = None - handler_args: dtcl.InitVar[tuple[h.Any, ...] | None] = None - handler_kwargs: dtcl.InitVar[dict[str, h.Any] | None] = None + path: d.InitVar[path_t | None] = None + handler_args: d.InitVar[tuple[h.Any, ...] | None] = None + handler_kwargs: d.InitVar[dict[str, h.Any] | None] = None def __post_init__( self, @@ -96,3 +71,50 @@ class file_handler_t(lggg.FileHandler): """""" print(message, file=self.stream) self.stream.flush() + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/handler/generic.py b/logger_36/catalog/handler/generic.py index 978e11b..f6460ed 100644 --- a/logger_36/catalog/handler/generic.py +++ b/logger_36/catalog/handler/generic.py @@ -1,52 +1,26 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import typing as h -from logger_36.catalog.config.console_rich import DATE_TIME_COLOR - try: + from logger_36.catalog.config.console_rich import DATE_TIME_COLOR + from logger_36.catalog.handler.console_rich import console_rich_handler_t from rich.console import Console as console_t from rich.console import ConsoleOptions as console_options_t from rich.markup import escape as EscapedForRich from rich.terminal_theme import DEFAULT_TERMINAL_THEME except ModuleNotFoundError: - console_t = EscapedForRich = DEFAULT_TERMINAL_THEME = None + console_t = console_options_t = EscapedForRich = DEFAULT_TERMINAL_THEME = None -from logger_36.catalog.handler.console_rich import console_rich_handler_t from logger_36.constant.record import SHOW_W_RULE_ATTR from logger_36.task.format.rule import Rule, RuleAsText -from logger_36.type.extension import handler_extension_t +from logger_36.type.handler import handler_extension_t class can_show_message_p(h.Protocol): @@ -56,25 +30,25 @@ class can_show_message_p(h.Protocol): interface_h = can_show_message_p | h.Callable[[str], None] -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class generic_handler_t(lggg.Handler): - extension: handler_extension_t = dtcl.field(init=False) - console: console_t | None = None - console_options: console_options_t | None = None - FormattedLines: h.Callable[..., tuple[str, str | None]] = dtcl.field(init=False) + extension: handler_extension_t = d.field(init=False) + console: console_t = None + console_options: console_options_t = None + FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False) ShowMessage: h.Callable[[str], None] = lambda _arg: None - name: dtcl.InitVar[str | None] = None - level: dtcl.InitVar[int] = lggg.NOTSET - show_where: dtcl.InitVar[bool] = True - show_memory_usage: dtcl.InitVar[bool] = False - message_width: dtcl.InitVar[int] = -1 - formatter: dtcl.InitVar[lggg.Formatter | None] = None + name: d.InitVar[str | None] = None + level: d.InitVar[int] = lggg.NOTSET + show_where: d.InitVar[bool] = True + show_memory_usage: d.InitVar[bool] = False + message_width: d.InitVar[int] = -1 + formatter: d.InitVar[lggg.Formatter | None] = None - supports_html: dtcl.InitVar[bool] = False - rich_kwargs: dtcl.InitVar[dict[str, h.Any] | None] = None - interface: dtcl.InitVar[interface_h | None] = None # Cannot be None actually. + supports_html: d.InitVar[bool] = False + rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None + interface: d.InitVar[interface_h | None] = None # Cannot be None actually. def __post_init__( self, @@ -159,3 +133,50 @@ class generic_handler_t(lggg.Handler): ) self.ShowMessage(message) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/logging/chronos.py b/logger_36/catalog/logging/chronos.py index 0b2ccdd..87f9e72 100644 --- a/logger_36/catalog/logging/chronos.py +++ b/logger_36/catalog/logging/chronos.py @@ -1,39 +1,62 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" from logger_36.constant.logger import HIDE_WHERE_KWARG -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER from logger_36.task.measure.chronos import ElapsedTime +from logger_36.type.logger import logger_t -def LogElapsedTime() -> None: +def LogElapsedTime(*, logger: logger_t = LOGGER) -> None: """""" - LOGGER.info(f"Elapsed Time: {ElapsedTime()}", **HIDE_WHERE_KWARG) + logger.info(f"Elapsed Time: {ElapsedTime()}", **HIDE_WHERE_KWARG) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/logging/exception.py b/logger_36/catalog/logging/exception.py new file mode 100644 index 0000000..ac94259 --- /dev/null +++ b/logger_36/catalog/logging/exception.py @@ -0,0 +1,74 @@ +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import traceback as tcbk + +from logger_36.instance.logger import LOGGER +from logger_36.type.logger import logger_t + + +def LogException( + exception: Exception, + /, + *, + logger: logger_t = LOGGER, + should_remove_caller: bool = False, +) -> None: + """""" + lines = tcbk.format_exception(exception) + if should_remove_caller: + message = "\n".join(lines[:1] + lines[2:]) + else: + formatted = "".join(lines) + message = f"{type(exception).__name__}:\n{formatted}" + logger.error(message) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/logging/gpu.py b/logger_36/catalog/logging/gpu.py index a6d59c6..c3dd58f 100644 --- a/logger_36/catalog/logging/gpu.py +++ b/logger_36/catalog/logging/gpu.py @@ -1,39 +1,15 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import sys as sstm from logger_36.constant.error import GPU_LOGGING_ERROR from logger_36.constant.logger import HIDE_WHERE_KWARG -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER +from logger_36.type.logger import logger_t try: import tensorflow as tsfl @@ -45,7 +21,7 @@ except ModuleNotFoundError: _GPU_LOGGING_ERROR = GPU_LOGGING_ERROR -def LogGPURelatedDetails() -> None: +def LogGPURelatedDetails(*, logger: logger_t = LOGGER) -> None: """""" global _GPU_LOGGING_ERROR @@ -56,7 +32,7 @@ def LogGPURelatedDetails() -> None: return system_details = tsfl.sysconfig.get_build_info() - LOGGER.info( + logger.info( f"GPU-RELATED DETAILS\n" f" GPUs: {tsfl.config.list_physical_devices('GPU')}\n" f" CPUs: {tsfl.config.list_physical_devices('CPU')}\n" @@ -67,3 +43,50 @@ def LogGPURelatedDetails() -> None: f" TensorRT: {tsrt.__version__}", **HIDE_WHERE_KWARG, ) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/logging/memory.py b/logger_36/catalog/logging/memory.py index b96ec32..e5512a2 100644 --- a/logger_36/catalog/logging/memory.py +++ b/logger_36/catalog/logging/memory.py @@ -1,40 +1,16 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" from logger_36.config.memory import LENGTH_100, MAX_N_SAMPLES from logger_36.constant.logger import HIDE_WHERE_KWARG from logger_36.constant.memory import storage_units_h -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER from logger_36.task.format.memory import FormattedUsage, UsageBar from logger_36.task.format.message import FormattedMessage +from logger_36.type.logger import logger_t def LogMemoryUsages( @@ -43,14 +19,15 @@ def LogMemoryUsages( decimals: int = None, max_n_samples: int | None = MAX_N_SAMPLES, length_100: int = LENGTH_100, + logger: logger_t = LOGGER, ) -> None: """""" - if not LOGGER.any_handler_shows_memory: + if not logger.any_handler_shows_memory: return - where_s, usages = zip(*LOGGER.memory_usages) + where_s, usages = zip(*logger.memory_usages) - where, max_usage = LOGGER.max_memory_usage_full + where, max_usage = logger.max_memory_usage_full value, unit = FormattedUsage(max_usage, unit=unit, decimals=decimals) title = f"Memory Usage: Max={value}{unit} near {where}\n" @@ -88,18 +65,68 @@ def LogMemoryUsages( ) plot = "\n".join(plot) - LOGGER.info(title + plot, **HIDE_WHERE_KWARG) + logger.info(title + plot, **HIDE_WHERE_KWARG) def LogMaximumMemoryUsage( - *, unit: storage_units_h | None = "a", decimals: int = None + *, + unit: storage_units_h | None = "a", + decimals: int = None, + logger: logger_t = LOGGER, ) -> None: """ unit: b or None=bytes, k=kilo, m=mega, g=giga, a=auto """ - if LOGGER.any_handler_shows_memory: - where, max_usage = LOGGER.max_memory_usage_full + if logger.any_handler_shows_memory: + where, max_usage = logger.max_memory_usage_full value, unit = FormattedUsage(max_usage, unit=unit, decimals=decimals) - LOGGER.info( + logger.info( f"Max. Memory Usage: {value}{unit} near {where}", **HIDE_WHERE_KWARG ) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/catalog/logging/system.py b/logger_36/catalog/logging/system.py index 228a841..03349e7 100644 --- a/logger_36/catalog/logging/system.py +++ b/logger_36/catalog/logging/system.py @@ -1,38 +1,14 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" from logger_36.constant.logger import HIDE_WHERE_KWARG from logger_36.constant.system import MAX_DETAIL_NAME_LENGTH, SYSTEM_DETAILS_AS_DICT -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER from logger_36.task.inspection import Modules +from logger_36.type.logger import logger_t def LogSystemDetails( @@ -40,6 +16,7 @@ def LogSystemDetails( modules_with_version: bool = True, modules_formatted: bool = True, should_restrict_modules_to_loaded: bool = True, + logger: logger_t = LOGGER, ) -> None: """""" details = "\n".join( @@ -53,10 +30,57 @@ def LogSystemDetails( indent=4, ) - LOGGER.info( + logger.info( f"SYSTEM DETAILS\n" f"{details}\n" f" {'Python Modules':>{MAX_DETAIL_NAME_LENGTH}}:\n" f"{modules}", **HIDE_WHERE_KWARG, ) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/config/issue.py b/logger_36/config/issue.py index eca202e..dfa0672 100644 --- a/logger_36/config/issue.py +++ b/logger_36/config/issue.py @@ -1,35 +1,56 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" ISSUE_BASE_CONTEXT = "BASE" ISSUE_CONTEXT_SEPARATOR = ">" ISSUE_CONTEXT_END = ":: " + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/config/memory.py b/logger_36/config/memory.py index e33e2ad..9a283e1 100644 --- a/logger_36/config/memory.py +++ b/logger_36/config/memory.py @@ -1,33 +1,54 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" MAX_N_SAMPLES = 10 LENGTH_100 = 20 + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/config/message.py b/logger_36/config/message.py index 66b3531..d71812c 100644 --- a/logger_36/config/message.py +++ b/logger_36/config/message.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" LEVEL_OPENING = "(" LEVEL_CLOSING = ")" @@ -44,3 +19,49 @@ MEMORY_FORMAT = f" {MEMORY_SEPARATOR}%(memory_usage)s" ACTUAL_PATTERNS: str = r" Actual=" EXPECTED_PATTERNS: str = r" Expected([!<>]?=|: )" + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/config/system.py b/logger_36/config/system.py index 64a8583..4f64495 100644 --- a/logger_36/config/system.py +++ b/logger_36/config/system.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" SYSTEM_DETAILS = ( "node", @@ -47,3 +22,49 @@ SYSTEM_DETAILS = ( "python_compiler", "python_build", ) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/error.py b/logger_36/constant/error.py index e12d5e1..1c7d6d4 100644 --- a/logger_36/constant/error.py +++ b/logger_36/constant/error.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" GPU_LOGGING_ERROR = ( "GPU details cannot be logged because the Tensorflow and/or Tensorrt package(s) " @@ -47,3 +22,49 @@ MISSING_RICH_ERROR = ( "is not installed or not importable. " "Falling back to the raw console." ) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/generic.py b/logger_36/constant/generic.py index e676842..afff9e2 100644 --- a/logger_36/constant/generic.py +++ b/logger_36/constant/generic.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" class _not_passed_t: @@ -35,3 +10,49 @@ class _not_passed_t: NOT_PASSED = _not_passed_t() + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/handler.py b/logger_36/constant/handler.py index 5a41fbb..04a61dc 100644 --- a/logger_36/constant/handler.py +++ b/logger_36/constant/handler.py @@ -1,35 +1,56 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import typing as h handler_codes_h = h.Literal["g", "c", "f", "a"] HANDLER_CODES: tuple[str, ...] = h.get_args(handler_codes_h) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/issue.py b/logger_36/constant/issue.py index 96e9497..a37933c 100644 --- a/logger_36/constant/issue.py +++ b/logger_36/constant/issue.py @@ -1,35 +1,56 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import typing as h order_h = h.Literal["when", "context"] ORDER: tuple[str, ...] = h.get_args(order_h) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/logger.py b/logger_36/constant/logger.py index 64f0624..eeebb75 100644 --- a/logger_36/constant/logger.py +++ b/logger_36/constant/logger.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import logging as lggg import re as regx @@ -48,3 +23,49 @@ HIDE_WHERE_KWARG = {"extra": {HIDE_WHERE_ATTR: True}} logger_handle_h = ( h.Callable[[lggg.LogRecord], None] | h.Callable[[lggg.Logger, lggg.LogRecord], None] ) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/memory.py b/logger_36/constant/memory.py index 1fbc91d..3f1a15a 100644 --- a/logger_36/constant/memory.py +++ b/logger_36/constant/memory.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import typing as h @@ -35,3 +10,49 @@ storage_units_h = h.Literal["b", "k", "m", "g", "a"] STORAGE_UNITS: tuple[str, ...] = h.get_args(storage_units_h) UNKNOWN_MEMORY_USAGE = -1 + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/message.py b/logger_36/constant/message.py index ac06fb1..f3e3205 100644 --- a/logger_36/constant/message.py +++ b/logger_36/constant/message.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import time import typing as h @@ -46,3 +21,49 @@ NEXT_LINE_PROLOGUE = "\n" + (CONTEXT_LENGTH + MESSAGE_MARKER.__len__() + 1) * " expected_op_h = h.Literal[": ", "=", "!=", ">=", "<="] EXPECTED_OP: tuple[str, ...] = h.get_args(expected_op_h) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/record.py b/logger_36/constant/record.py index 4b9ee73..e6f2e30 100644 --- a/logger_36/constant/record.py +++ b/logger_36/constant/record.py @@ -1,35 +1,56 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" SHOW_W_RULE_ATTR = "show_w_rule" SHOW_WHERE_ATTR = "where" HIDE_WHERE_ATTR = "hide_where" SHOW_MEMORY_ATTR = "show_memory_usage" + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/constant/system.py b/logger_36/constant/system.py index abb547f..628cbae 100644 --- a/logger_36/constant/system.py +++ b/logger_36/constant/system.py @@ -1,39 +1,67 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import platform as pltf +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +try: + import platform as pltf +except ModuleNotFoundError: + pltf = None from logger_36.config.system import SYSTEM_DETAILS -SYSTEM_DETAILS_AS_DICT = { - _dtl.capitalize(): getattr(pltf, _dtl)() for _dtl in SYSTEM_DETAILS -} -MAX_DETAIL_NAME_LENGTH = max(map(len, SYSTEM_DETAILS_AS_DICT.keys())) +if pltf is None: + SYSTEM_DETAILS_AS_DICT = {} + MAX_DETAIL_NAME_LENGTH = 0 +else: + SYSTEM_DETAILS_AS_DICT = { + _dtl.capitalize(): getattr(pltf, _dtl)() for _dtl in SYSTEM_DETAILS + } + MAX_DETAIL_NAME_LENGTH = max(map(len, SYSTEM_DETAILS_AS_DICT.keys())) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/instance.py b/logger_36/instance.py deleted file mode 100644 index a45d7fc..0000000 --- a/logger_36/instance.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from logger_36.type.logger import logger_t - -LOGGER = logger_t() diff --git a/logger_36/instance/logger.py b/logger_36/instance/logger.py new file mode 100644 index 0000000..9fc6540 --- /dev/null +++ b/logger_36/instance/logger.py @@ -0,0 +1,55 @@ +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +from logger_36.type.logger import logger_t + +LOGGER = logger_t() + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/instance/loggers.py b/logger_36/instance/loggers.py new file mode 100644 index 0000000..b8da150 --- /dev/null +++ b/logger_36/instance/loggers.py @@ -0,0 +1,56 @@ +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +from logger_36.type.loggers import loggers_t + +LOGGERS = loggers_t() + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/main.py b/logger_36/main.py index ad78dc8..91317f3 100644 --- a/logger_36/main.py +++ b/logger_36/main.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import logging as lggg import sys as sstm @@ -38,7 +13,7 @@ from logger_36.catalog.handler.file import file_handler_t from logger_36.catalog.handler.generic import generic_handler_t, interface_h from logger_36.constant.error import MISSING_RICH_ERROR from logger_36.constant.handler import HANDLER_CODES, handler_codes_h -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER from logger_36.task.format.message import FormattedMessage try: @@ -134,6 +109,13 @@ def AddRichConsoleHandler( if logger is None: logger = LOGGER + if console_rich_handler_t is console_handler_t: + additional_s = {} + else: + additional_s = { + "should_install_traceback": should_install_traceback, + "rich_kwargs": kwargs, + } handler = console_rich_handler_t( name=name, level=level, @@ -141,8 +123,7 @@ def AddRichConsoleHandler( show_memory_usage=show_memory_usage, message_width=message_width, formatter=formatter, - should_install_traceback=should_install_traceback, - rich_kwargs=kwargs, + **additional_s, ) logger.AddHandler(handler, should_hold_messages) @@ -222,3 +203,50 @@ def SetLOGLevel( expected=f"{str(HANDLER_CODES)[1:-1]}, or a handler name", ) ) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/format/memory.py b/logger_36/task/format/memory.py index 4d6f73b..1f6cc53 100644 --- a/logger_36/task/format/memory.py +++ b/logger_36/task/format/memory.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" from logger_36.constant.memory import STORAGE_UNITS, storage_units_h from logger_36.task.format.message import FormattedMessage @@ -108,3 +83,50 @@ def _Rounded(value: float, decimals: int | None, /) -> int | float: decimals = None return round(value, ndigits=decimals) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/format/message.py b/logger_36/task/format/message.py index 8aac44a..6b4fbb6 100644 --- a/logger_36/task/format/message.py +++ b/logger_36/task/format/message.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import typing as h @@ -110,3 +85,50 @@ def _FormattedValue(value: h.Any, /, *, should_format_str: bool = True) -> str: return value return str(value) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/format/rule.py b/logger_36/task/format/rule.py index 454e2f1..f64ced3 100644 --- a/logger_36/task/format/rule.py +++ b/logger_36/task/format/rule.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" def RuleAsText(text: str, /) -> str: @@ -45,3 +20,49 @@ try: except ModuleNotFoundError: Rule = lambda _txt, _: RuleAsText(_txt) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/inspection.py b/logger_36/task/inspection.py index c00802c..06d152a 100644 --- a/logger_36/task/inspection.py +++ b/logger_36/task/inspection.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import importlib.metadata as mprt import pkgutil as pkgs @@ -125,3 +100,50 @@ def _ModulesUsingImportlib() -> tuple[str, ...]: if (_elm[0] != "_") and ("__" not in _elm) and ("/" not in _elm) ) ) + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/measure/chronos.py b/logger_36/task/measure/chronos.py index 9c1dcfa..330ab6f 100644 --- a/logger_36/task/measure/chronos.py +++ b/logger_36/task/measure/chronos.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import time from datetime import datetime as dttm @@ -55,3 +30,50 @@ def ElapsedTime() -> str: output = output.split(maxsplit=1)[-1] return output + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/measure/memory.py b/logger_36/task/measure/memory.py index ea341ee..a0ccd78 100644 --- a/logger_36/task/measure/memory.py +++ b/logger_36/task/measure/memory.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" try: from psutil import Process as process_t @@ -48,3 +23,50 @@ def CurrentUsage() -> int: return -1 return _PROCESS.memory_info().rss + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/task/storage.py b/logger_36/task/storage.py index d358fc8..b4c293d 100644 --- a/logger_36/task/storage.py +++ b/logger_36/task/storage.py @@ -1,35 +1,10 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import re as regx import typing as h @@ -41,18 +16,18 @@ try: except ModuleNotFoundError: console_t = None -from logger_36.instance import LOGGER +from logger_36.instance.logger import LOGGER _BODY_END_PATTERN = r"</[bB][oO][dD][yY]>(.|\n)*$" -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class html_reader_t(html_parser_t): source: str = "" - inside_body: bool = dtcl.field(init=False, default=False) - body_position_start: tuple[int, int] = dtcl.field(init=False, default=(-1, -1)) - body_position_end: tuple[int, int] = dtcl.field(init=False, default=(-1, -1)) - pieces: list[str] = dtcl.field(init=False, default_factory=list) + inside_body: bool = d.field(init=False, default=False) + body_position_start: tuple[int, int] = d.field(init=False, default=(-1, -1)) + body_position_end: tuple[int, int] = d.field(init=False, default=(-1, -1)) + pieces: list[str] = d.field(init=False, default_factory=list) def __post_init__(self) -> None: """""" @@ -142,3 +117,50 @@ def SaveLOGasHTML(path: str | path_t | h.TextIO = None) -> None: path.write(html) else: LOGGER.warning(f"{cannot_save}: No handler has a RICH console.") + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/type/extension.py b/logger_36/type/handler.py similarity index 70% rename from logger_36/type/extension.py rename to logger_36/type/handler.py index 8886908..e3658b8 100644 --- a/logger_36/type/extension.py +++ b/logger_36/type/handler.py @@ -1,35 +1,10 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import sys as sstm import typing as h @@ -48,17 +23,17 @@ from logger_36.task.measure.memory import CanCheckMemory _MEMORY_MEASURE_ERROR = MEMORY_MEASURE_ERROR -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class handler_extension_t: name: str | None = None show_where: bool = True show_memory_usage: bool = False message_width: int = -1 - FormattedRecord: h.Callable[[lggg.LogRecord], str] = dtcl.field(init=False) + FormattedRecord: h.Callable[[lggg.LogRecord], str] = d.field(init=False) - handler: dtcl.InitVar[lggg.Handler | None] = None - level: dtcl.InitVar[int] = lggg.NOTSET - formatter: dtcl.InitVar[lggg.Formatter | None] = None + handler: d.InitVar[lggg.Handler | None] = None + level: d.InitVar[int] = lggg.NOTSET + formatter: d.InitVar[lggg.Formatter | None] = None def __post_init__( self, handler: lggg.Handler | None, level: int, formatter: lggg.Formatter | None @@ -199,3 +174,50 @@ def _WrappedLines(lines: list[str], message_width: int, /) -> list[str]: output.append(line) return output + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/type/issue.py b/logger_36/type/issue.py index 75d0b49..ee5b6be 100644 --- a/logger_36/type/issue.py +++ b/logger_36/type/issue.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import typing as h @@ -62,3 +37,50 @@ def NewIssue( ) return f"{context}{separator}{message}" + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/type/logger.py b/logger_36/type/logger.py index 65bcb67..3c94037 100644 --- a/logger_36/type/logger.py +++ b/logger_36/type/logger.py @@ -1,37 +1,10 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -from __future__ import annotations - -import dataclasses as dtcl +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d import logging as lggg import sys as sstm import traceback as tbck @@ -64,33 +37,31 @@ from logger_36.task.measure.memory import CurrentUsage as CurrentMemoryUsage from logger_36.type.issue import NewIssue, issue_t -@dtcl.dataclass(slots=True, repr=False, eq=False) +@d.dataclass(slots=True, repr=False, eq=False) class logger_t(lggg.Logger): - name: dtcl.InitVar[str] = LOGGER_NAME - level: dtcl.InitVar[int] = lggg.NOTSET - activate_wrn_interceptions: dtcl.InitVar[bool] = True + name_: d.InitVar[str] = LOGGER_NAME + level: d.InitVar[int] = lggg.NOTSET + activate_wrn_interceptions: d.InitVar[bool] = True exit_on_error: bool = False # Must not be False until at least one handler has been added. should_hold_messages: bool = True - on_hold: list[lggg.LogRecord] = dtcl.field(init=False, default_factory=list) - last_message_date: str = dtcl.field(init=False, default="") - any_handler_shows_memory: bool = dtcl.field(init=False, default=False) - memory_usages: list[tuple[str, int]] = dtcl.field(init=False, default_factory=list) - context_levels: list[str] = dtcl.field(init=False, default_factory=list) - staged_issues: list[issue_t] = dtcl.field(init=False, default_factory=list) - intercepted_wrn_handle: logger_handle_h | None = dtcl.field( - init=False, default=None - ) - intercepted_log_handles: dict[str, logger_handle_h] = dtcl.field( + on_hold: list[lggg.LogRecord] = d.field(init=False, default_factory=list) + last_message_date: str = d.field(init=False, default="") + any_handler_shows_memory: bool = d.field(init=False, default=False) + memory_usages: list[tuple[str, int]] = d.field(init=False, default_factory=list) + context_levels: list[str] = d.field(init=False, default_factory=list) + staged_issues: list[issue_t] = d.field(init=False, default_factory=list) + intercepted_wrn_handle: logger_handle_h | None = d.field(init=False, default=None) + intercepted_log_handles: dict[str, logger_handle_h] = d.field( init=False, default_factory=dict ) def __post_init__( - self, name: str, level: int, activate_wrn_interceptions: bool + self, name_: str, level: int, activate_wrn_interceptions: bool ) -> None: """""" - lggg.Logger.__init__(self, name) + lggg.Logger.__init__(self, name_) self.setLevel(level) self.propagate = False @@ -247,7 +218,7 @@ class logger_t(lggg.Logger): """""" self.context_levels.append(new_level) - def AddedContextLevel(self, new_level: str, /) -> logger_t: + def AddedContextLevel(self, new_level: str, /) -> h.Self: """ Meant to be used as: with self.AddedContextLevel("new level"): @@ -322,6 +293,7 @@ class logger_t(lggg.Logger): print("\n".join(lines), file=sstm.stderr) sstm.exit(1) + level: int self.log(level, issues, stacklevel=2) self.staged_issues.clear() @@ -387,3 +359,50 @@ def _HandleForInterceptions( interceptor.handle(duplicate) return handle_p + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/type/loggers.py b/logger_36/type/loggers.py new file mode 100644 index 0000000..78b22ab --- /dev/null +++ b/logger_36/type/loggers.py @@ -0,0 +1,78 @@ +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +import dataclasses as d +import typing as h + +from logger_36.type.logger import logger_t + + +@d.dataclass(slots=True, repr=False, eq=False) +class loggers_t(dict[h.Hashable, logger_t]): + active: logger_t | None = d.field(init=False, default=None) + + def AddNew(self, uid: h.Hashable, /) -> None: + """""" + self.Add(uid, logger_t()) + + def Add(self, uid: h.Hashable, logger: logger_t, /) -> None: + """""" + if uid in self: + raise NameError(f"Logger with name/identity {uid} already exists.") + + self[uid] = logger + self.active = logger + + def SetActive(self, uid: h.Hashable, /) -> None: + """""" + self.active = self[uid] + + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/logger_36/version.py b/logger_36/version.py index 1a78f40..01ee154 100644 --- a/logger_36/version.py +++ b/logger_36/version.py @@ -1,32 +1,53 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -__version__ = "2024.15" +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" + +__version__ = "2024.16" + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/setup.py b/setup.py index ebb758c..ec5415a 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import re as rgex from importlib import util @@ -66,6 +41,7 @@ PACKAGES = [ f"{DESCRIPTION['IMPORT_NAME']}.catalog.logging", f"{DESCRIPTION['IMPORT_NAME']}.config", f"{DESCRIPTION['IMPORT_NAME']}.constant", + f"{DESCRIPTION['IMPORT_NAME']}.instance", f"{DESCRIPTION['IMPORT_NAME']}.task", f"{DESCRIPTION['IMPORT_NAME']}.task.format", f"{DESCRIPTION['IMPORT_NAME']}.task.measure", @@ -175,3 +151,49 @@ if __name__ == "__main__": python_requires=f">={DESCRIPTION['PY_VERSION_MIN']}", install_requires=Requirements(), ) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" diff --git a/test/main.py b/test/main.py index 40776b7..cf436ae 100644 --- a/test/main.py +++ b/test/main.py @@ -1,33 +1,8 @@ -# Copyright CNRS/Inria/UniCA -# Contributor(s): Eric Debreuve (since 2023) -# -# eric.debreuve@cnrs.fr -# -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". -# -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. -# -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. -# -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. +""" +Copyright CNRS/Inria/UniCA +Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023 +SEE COPYRIGHT NOTICE BELOW +""" import difflib as diff import logging as lggg @@ -146,3 +121,49 @@ sstm.stdout.writelines( n=0, ) ) + +""" +COPYRIGHT NOTICE + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. + +SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root. + +This software is being developed by Eric Debreuve, a CNRS employee and +member of team Morpheme. +Team Morpheme is a joint team between Inria, CNRS, and UniCA. +It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory +I3S, and Laboratory iBV. + +CNRS: https://www.cnrs.fr/index.php/en +Inria: https://www.inria.fr/en/ +UniCA: https://univ-cotedazur.eu/ +Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/ +I3S: https://www.i3s.unice.fr/en/ +iBV: http://ibv.unice.fr/ +Team Morpheme: https://team.inria.fr/morpheme/ +""" -- GitLab