From 22fdde20ba5805128a804fb6331e2a46b6396957 Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Thu, 13 Apr 2023 12:53:51 +0000
Subject: [PATCH] Remove old logger from python bindings

---
 Python/actuator_line/actuator_line.py         |  5 +-
 Python/boundary_layer/boundary_layer.py       |  5 +-
 .../pyfluids-stubs/bindings/basics/logger.pyi | 83 -------------------
 pythonbindings/src/basics/basics.cpp          |  4 +-
 .../src/basics/submodules/logger.cpp          | 68 ---------------
 5 files changed, 3 insertions(+), 162 deletions(-)
 delete mode 100644 pythonbindings/pyfluids-stubs/bindings/basics/logger.pyi
 delete mode 100644 pythonbindings/src/basics/submodules/logger.cpp

diff --git a/Python/actuator_line/actuator_line.py b/Python/actuator_line/actuator_line.py
index e28947cc4..d0589f402 100644
--- a/Python/actuator_line/actuator_line.py
+++ b/Python/actuator_line/actuator_line.py
@@ -46,10 +46,7 @@ output_path.mkdir(exist_ok=True)
 
 #%%
 logger.Logger.initialize_logger()
-basics.logger.Logger.add_stdout()
-basics.logger.Logger.set_debug_level(basics.logger.Level.INFO_LOW)
-basics.logger.Logger.time_stamp(basics.logger.TimeStamp.ENABLE)
-basics.logger.Logger.enable_printed_rank_numbers(True)
+
 #%%
 grid_factory = gpu.grid_generator.GridFactory.make()
 grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory)
diff --git a/Python/boundary_layer/boundary_layer.py b/Python/boundary_layer/boundary_layer.py
index 38c1b2256..25b3cd895 100644
--- a/Python/boundary_layer/boundary_layer.py
+++ b/Python/boundary_layer/boundary_layer.py
@@ -46,10 +46,7 @@ output_path.mkdir(exist_ok=True)
 
 #%%
 logger.Logger.initialize_logger()
-basics.logger.Logger.add_stdout()
-basics.logger.Logger.set_debug_level(basics.logger.Level.INFO_LOW)
-basics.logger.Logger.time_stamp(basics.logger.TimeStamp.ENABLE)
-basics.logger.Logger.enable_printed_rank_numbers(True)
+
 #%%
 grid_factory = gpu.grid_generator.GridFactory.make()
 grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory)
diff --git a/pythonbindings/pyfluids-stubs/bindings/basics/logger.pyi b/pythonbindings/pyfluids-stubs/bindings/basics/logger.pyi
deleted file mode 100644
index 43938ff76..000000000
--- a/pythonbindings/pyfluids-stubs/bindings/basics/logger.pyi
+++ /dev/null
@@ -1,83 +0,0 @@
-r"""
-=======================================================================================
- ____          ____    __    ______     __________   __      __       __        __
- \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
-  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
-   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
-    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
-     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
-      \    \  |    |   ________________________________________________________________
-       \    \ |    |  |  ______________________________________________________________|
-        \    \|    |  |  |         __          __     __     __     ______      _______
-         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
-          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
-           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
-
-  This file is part of VirtualFluids. VirtualFluids is free software: you can
-  redistribute it and/or modify it under the terms of the GNU General Public
-  License as published by the Free Software Foundation, either version 3 of
-  the License, or (at your option) any later version.
-
-  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  for more details.
-
-  You should have received a copy of the GNU General Public License along
-  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
-
-! \file logger.pyi
-! \ingroup basics
-! \author Henry Korb
-=======================================================================================
-"""
-from typing import Any, ClassVar
-
-log: None
-
-class Level:
-    __members__: ClassVar[dict] = ...  # read-only
-    INFO_HIGH: ClassVar[Level] = ...
-    INFO_INTERMEDIATE: ClassVar[Level] = ...
-    INFO_LOW: ClassVar[Level] = ...
-    LOGGER_ERROR: ClassVar[Level] = ...
-    WARNING: ClassVar[Level] = ...
-    __entries: ClassVar[dict] = ...
-    def __init__(self, arg0: int) -> None: ...
-    def __eq__(self, arg0: object) -> bool: ...
-    def __getstate__(self) -> int: ...
-    def __hash__(self) -> int: ...
-    def __index__(self) -> int: ...
-    def __int__(self) -> int: ...
-    def __ne__(self, arg0: object) -> bool: ...
-    def __setstate__(self, arg0: int) -> None: ...
-    @property
-    def name(self) -> str: ...
-
-class Logger:
-    def __init__(self, *args, **kwargs) -> None: ...
-    @staticmethod
-    def add_stdout() -> None: ...
-    @staticmethod
-    def enable_printed_rank_numbers(print: bool) -> None: ...
-    @staticmethod
-    def set_debug_level(level: int) -> None: ...
-    @staticmethod
-    def time_stamp(time_stemp: TimeStamp) -> None: ...
-
-class TimeStamp:
-    __members__: ClassVar[dict] = ...  # read-only
-    DISABLE: ClassVar[TimeStamp] = ...
-    ENABLE: ClassVar[TimeStamp] = ...
-    __entries: ClassVar[dict] = ...
-    def __init__(self, arg0: int) -> None: ...
-    def __eq__(self, arg0: object) -> bool: ...
-    def __getstate__(self) -> int: ...
-    def __hash__(self) -> int: ...
-    def __index__(self) -> int: ...
-    def __int__(self) -> int: ...
-    def __ne__(self, arg0: object) -> bool: ...
-    def __setstate__(self, arg0: int) -> None: ...
-    @property
-    def name(self) -> str: ...
diff --git a/pythonbindings/src/basics/basics.cpp b/pythonbindings/src/basics/basics.cpp
index daba29cdc..0b294b7a8 100644
--- a/pythonbindings/src/basics/basics.cpp
+++ b/pythonbindings/src/basics/basics.cpp
@@ -31,7 +31,6 @@
 //! \author Henry Korb
 //=======================================================================================
 #include <pybind11/pybind11.h>
-#include "submodules/logger.cpp"
 #include "submodules/configuration_file.cpp"
 
 namespace basics
@@ -42,9 +41,8 @@ namespace basics
     {
         py::module basicsModule = parentModule.def_submodule("basics");
 
-        logger::makeModule(basicsModule);
         configuration::makeModule(basicsModule);
-        
+
         return basicsModule;
     }
 }
\ No newline at end of file
diff --git a/pythonbindings/src/basics/submodules/logger.cpp b/pythonbindings/src/basics/submodules/logger.cpp
deleted file mode 100644
index 38f45bc6e..000000000
--- a/pythonbindings/src/basics/submodules/logger.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//=======================================================================================
-// ____          ____    __    ______     __________   __      __       __        __
-// \    \       |    |  |  |  |   _   \  |___    ___| |  |    |  |     /  \      |  |
-//  \    \      |    |  |  |  |  |_)   |     |  |     |  |    |  |    /    \     |  |
-//   \    \     |    |  |  |  |   _   /      |  |     |  |    |  |   /  /\  \    |  |
-//    \    \    |    |  |  |  |  | \  \      |  |     |   \__/   |  /  ____  \   |  |____
-//     \    \   |    |  |__|  |__|  \__\     |__|      \________/  /__/    \__\  |_______|
-//      \    \  |    |   ________________________________________________________________
-//       \    \ |    |  |  ______________________________________________________________|
-//        \    \|    |  |  |         __          __     __     __     ______      _______
-//         \         |  |  |_____   |  |        |  |   |  |   |  |   |   _  \    /  _____)
-//          \        |  |   _____|  |  |        |  |   |  |   |  |   |  | \  \   \_______
-//           \       |  |  |        |  |_____   |   \_/   |   |  |   |  |_/  /    _____  |
-//            \ _____|  |__|        |________|   \_______/    |__|   |______/    (_______/
-//
-//  This file is part of VirtualFluids. VirtualFluids is free software: you can
-//  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of
-//  the License, or (at your option) any later version.
-//
-//  VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-//  for more details.
-//
-//  You should have received a copy of the GNU General Public License along
-//  with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
-//
-//! \file logger.cpp
-//! \ingroup submodules
-//! \author Henry Korb
-//=======================================================================================
-#include <pybind11/pybind11.h>
-#include <pybind11/iostream.h>
-#include <basics/Logger/Logger.h>
-#include <basics/Logger/implementations/LoggerImp.h>
-
-namespace logger
-{
-    namespace py = pybind11;
-
-    py::module makeModule(py::module_ &parentModule)
-    {
-        py::module loggerModule = parentModule.def_submodule("logger");
-
-        py::class_<logging::Logger>(loggerModule, "Logger")
-        .def_static("add_stdout", [](){
-            logging::Logger::addStream(&std::cout);
-        })
-        .def_static("set_debug_level", &logging::Logger::setDebugLevel)
-        .def_static("time_stamp", &logging::Logger::timeStamp, py::arg("time_stamp"))
-        .def_static("enable_printed_rank_numbers", &logging::Logger::enablePrintedRankNumbers, py::arg("print"));
-
-        loggerModule.attr("log") = logging::out;
-        py::enum_<logging::Logger::Level>(loggerModule, "Level")
-        .value("INFO_LOW", logging::Logger::Level::INFO_LOW)
-        .value("INFO_INTERMEDIATE", logging::Logger::Level::INFO_INTERMEDIATE)
-        .value("INFO_HIGH", logging::Logger::Level::INFO_HIGH)
-        .value("WARNING", logging::Logger::Level::WARNING)
-        .value("LOGGER_ERROR", logging::Logger::Level::LOGGER_ERROR);
-
-        py::enum_<logging::Logger::TimeStamp>(loggerModule, "TimeStamp")
-        .value("ENABLE", logging::Logger::TimeStamp::ENABLE)
-        .value("DISABLE", logging::Logger::TimeStamp::DISABLE);
-
-        return loggerModule;
-    }
-}
\ No newline at end of file
-- 
GitLab