Skip to content

Commit

Permalink
common: move Logger class in common module
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-iob committed May 19, 2021
1 parent 9cc3bcf commit 5101353
Show file tree
Hide file tree
Showing 43 changed files with 26 additions and 46 deletions.
1 change: 0 additions & 1 deletion examples/patchkernel_example_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <mpi.h>
#endif

#include "bitpit_IO.hpp"
#include "bitpit_patchkernel.hpp"

using namespace bitpit;
Expand Down
2 changes: 1 addition & 1 deletion examples/voloctree_adaptation_example_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <mpi.h>
#endif

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_voloctree.hpp"

using namespace bitpit;
Expand Down
2 changes: 0 additions & 2 deletions src/IO/bitpit_IO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
* @{
* @defgroup VTKEnums VTK Enumerations
* @}
* @defgroup Logger Logger
* @}
*/

#include "binary_archive.hpp"
#include "configuration.hpp"
#include "index_generator.hpp"
#include "logger.hpp"
#include "VTK.hpp"
#include "DGF.hpp"
#include "GenericIO.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/LA/system_solvers_large.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <string>
#include <unordered_set>

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"

#include "system_solvers_large.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/PABLO/ParaTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include "tree_constants.hpp"
#include "LocalTree.hpp"
#include "Map.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include <map>
#include <unordered_map>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion src/POD/pod_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <unordered_map>

#include "pod_common.hpp"
#include "bitpit_common.hpp"
#include "bitpit_patchkernel.hpp"
#include "bitpit_IO.hpp"

namespace bitpit {

Expand Down
2 changes: 1 addition & 1 deletion src/RBF/rbf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

#include "bitpit_private_lapacke.hpp"

#include "bitpit_common.hpp"
#include "bitpit_operators.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_SA.hpp"

#include "rbf.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/common/bitpit_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @defgroup common_strings String manipulation
* @defgroup common_binary Binary streams
* @defgroup common_hashing Hashing
* @defgroup common_logger Logger
* @defgroup common_misc Miscellaneous
* @defgroup common_macro Macros
* @defgroup common_constants Constants
Expand All @@ -42,6 +43,7 @@
#include "compiler.hpp"
#include "constants.hpp"
#include "fileHandler.hpp"
#include "logger.hpp"
#include "utils.hpp"

#include "moduleEnd.hpp"
Expand Down
12 changes: 8 additions & 4 deletions src/IO/logger.cpp → src/common/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@
#include <cmath>
#include <chrono>
#include <ctime>
#include <ostream>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <functional>
#include <sys/types.h>
#include <sys/stat.h>

#include "fileHandler.hpp"
#include "logger.hpp"

namespace bitpit{

/*!
\class LoggerBuffer
\ingroup Logger
\ingroup common_logger
\brief Stream buffer for the message logger.
This class implements a stream buffer used by the message logger.
Expand Down Expand Up @@ -416,7 +420,7 @@ const std::string LoggerBuffer::getTimestamp() const

/*!
\class Logger
\ingroup Logger
\ingroup common_logger
\brief Message logger.
This class implements a message logger. The logger allows to write
Expand Down Expand Up @@ -877,7 +881,7 @@ void Logger::print(const std::string &message, log::Priority priority, log::Visi

/*!
\class LoggerManager
\ingroup Logger
\ingroup common_logger
\brief Manager for the loggers.
This class implements a manager for the loggers. The manager allowes the
Expand Down
5 changes: 2 additions & 3 deletions src/IO/logger.hpp → src/common/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
#define __BITPIT_LOGGER_HPP__

#include <memory>
#include <ostream>
#include <unordered_map>
#include <vector>

#include "bitpit_common.hpp"

#define BITPIT_DEBUG_COUT(...) BITPIT_OVERLOAD_CALL(BITPIT_DEBUG_COUT, __VA_ARGS__)
#if BITPIT_ENABLE_DEBUG
#define BITPIT_DEBUG_COUT_0() bitpit::log::cout()
Expand Down Expand Up @@ -259,7 +258,7 @@ class LoggerManager


/*!
\ingroup Logger
\ingroup common_logger
\brief The namespace 'log' contains routines for interacting with the
message logger.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/communications/communications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#if BITPIT_ENABLE_MPI==1

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"

#include "communications.hpp"
#include "communications_tags.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/discretization/reconstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <limits>
#include <cblas.h>

#include "bitpit_IO.hpp"
#include "bitpit_LA.hpp"
#include "bitpit_operators.hpp"

Expand Down
2 changes: 0 additions & 2 deletions src/patchkernel/patch_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <iostream>
#include <unordered_map>

#include "bitpit_IO.hpp"

namespace bitpit {

class PatchManager {
Expand Down
1 change: 1 addition & 0 deletions src/surfunstructured/surfunstructured.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
\*---------------------------------------------------------------------------*/

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"

#include "surfunstructured.hpp"

Expand Down
1 change: 0 additions & 1 deletion src/surfunstructured/surfunstructured.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <array>
#include <vector>

#include "bitpit_IO.hpp"
#include "bitpit_patchkernel.hpp"

namespace bitpit {
Expand Down
2 changes: 1 addition & 1 deletion src/voloctree/voloctree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <cassert>
#include <cmath>

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"

#include "voloctree.hpp"

Expand Down
1 change: 0 additions & 1 deletion test/LA/test_LA_parallel_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <mpi.h>

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_LA.hpp"

using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_00002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_00003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_00004.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_00005.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_parallel_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_parallel_00002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace std;
using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_parallel_00003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace bitpit;

Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_parallel_00004.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

using namespace bitpit;

Expand Down
1 change: 0 additions & 1 deletion test/PABLO/test_PABLO_parallel_00006.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "bitpit_common.hpp"
#include "bitpit_PABLO.hpp"
#include "bitpit_IO.hpp"

#include <mpi.h>

Expand Down
1 change: 1 addition & 0 deletions test/RBF/test_RBF_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mpi.h>
#endif

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_RBF.hpp"

Expand Down
1 change: 1 addition & 0 deletions test/RBF/test_RBF_00003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include "bitpit_operators.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_RBF.hpp"

using namespace bitpit;
Expand Down
2 changes: 1 addition & 1 deletion test/communications/test_communications_parallel_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <mpi.h>

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_communications.hpp"

using namespace bitpit;
Expand Down
2 changes: 1 addition & 1 deletion test/communications/test_communications_parallel_00002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <mpi.h>

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_communications.hpp"

using namespace bitpit;
Expand Down
2 changes: 1 addition & 1 deletion test/discretization/test_discretization_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# include <mpi.h>
#endif

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_discretization.hpp"
#include "bitpit_volcartesian.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/levelset/test_levelset_parallel_00003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <mpi.h>

#include "bitpit_IO.hpp"
#include "bitpit_common.hpp"
#include "bitpit_surfunstructured.hpp"
#include "bitpit_voloctree.hpp"
#include "bitpit_levelset.hpp"
Expand Down
1 change: 0 additions & 1 deletion test/surfunstructured/test_surfunstructured_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

// BitPit
# include "bitpit_common.hpp" // Utilities and common definitions
# include "bitpit_IO.hpp" // Input/output
# include "bitpit_operators.hpp" // STL containers operators
# include "bitpit_patchkernel.hpp" // BitPit base patch
# include "bitpit_surfunstructured.hpp" // BitPit surftri patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
\*---------------------------------------------------------------------------*/

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_CG.hpp"
#include "bitpit_surfunstructured.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
\*---------------------------------------------------------------------------*/

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_CG.hpp"
#include "bitpit_surfunstructured.hpp"

Expand Down
1 change: 0 additions & 1 deletion test/voloctree/test_voloctree_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#endif

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_voloctree.hpp"

using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/voloctree/test_voloctree_00002.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#endif

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_voloctree.hpp"

using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/voloctree/test_voloctree_00003.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#endif

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_voloctree.hpp"

using namespace bitpit;
Expand Down
1 change: 0 additions & 1 deletion test/voloctree/test_voloctree_parallel_00001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <unordered_map>

#include "bitpit_common.hpp"
#include "bitpit_IO.hpp"
#include "bitpit_voloctree.hpp"

using namespace bitpit;
Expand Down
Loading

0 comments on commit 5101353

Please sign in to comment.