Skip to content

Commit

Permalink
docs(core): move logging docs to its dir
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 5, 2023
1 parent 6d43e82 commit fcc60af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@

Logging in **CUBOS.** is done through the logging macros defined in @ref core/log.hpp.

@dontinclude logging.cpp
@snippet logging.cpp Logging include
@snippet logging/main.cpp Logging include

Before any logging is done, the logger must be initialized.
This usually happens right at the beginning of the program.

@snippet logging.cpp Logger initialization
@snippet logging/main.cpp Logger initialization

There are six logging levels, each with its own macro.
In order of increasing severity, they are:

@snippet logging.cpp Logging macros
@snippet logging/main.cpp Logging macros

These macros can also take arguments:

@snippet logging.cpp Logging macros with arguments
@snippet logging/main.cpp Logging macros with arguments

@note By default, on debug builds all messages are logged, while on release builds only messages with
severity level @ref CUBOS_LOG_LEVEL_INFO or higher are logged. This can be changed by defining
@ref CUBOS_LOG_LEVEL to the desired level.

Serializable types can also be logged, using @ref cubos::core::data::Debug.

@snippet logging.cpp Debug wrapper include
@snippet logging/main.cpp Debug wrapper include

By wrapping the value in @ref cubos::core::data::Debug, the type is serialized using the
@ref cubos::core::data::DebugSerializer, and the result is logged.

@snippet logging.cpp Debug wrapper usage
@snippet logging/main.cpp Debug wrapper usage
4 changes: 3 additions & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ PROJECT_NUMBER = @DOXYGEN_PROJECT_VERSION@
# Add sources
INPUT = @DOXYGEN_PROJECT_ROOT@/docs/pages \
@DOXYGEN_PROJECT_ROOT@/core/include \
@DOXYGEN_PROJECT_ROOT@/engine/include
@DOXYGEN_PROJECT_ROOT@/core/samples \
@DOXYGEN_PROJECT_ROOT@/engine/include \
@DOXYGEN_PROJECT_ROOT@/engine/samples
EXAMPLE_PATH = @DOXYGEN_PROJECT_ROOT@/core/samples \
@DOXYGEN_PROJECT_ROOT@/engine/samples
EXTRACT_ALL = YES
Expand Down

0 comments on commit fcc60af

Please sign in to comment.