Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of the Logging Infrastructure #1596

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from

Commits on Sep 20, 2024

  1. Pulled ostream operators for IPAddress and MacAddress into the namesp…

    …ace to satisfy ADL requirements.
    Dimi1010 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    0293115 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Refactor of Logger.

    - LogLevel is now a top level enum class.
    - Added a new log level Off to disable output from a specific module.
    - Logger::LogLevel is a deprecated alias to LogLevel.
    - Logger::Info, Debug, Error are deprecated aliases to LogLevel::...
    - Removed public "internal*" functions from Logger.Logger
    - Added LogSource struct to encapsulate source information.
    - Added shouldLog method to check if a log should be emitted for a given level and module.
    - Removed nonfunctional artifacts "m_LogStream" and "Logger::operator<<"
    - Added templated "log" functions that are friends to Logger.
    - Reworked PCPP_LOG macros to no longer utilize the now removed internal functions.
    - Added PCPP_LOG_INFO macro level.
    - Changed PCPP_LOG_ERROR to now check if the log should be emitted.
    - Fixed NetworkUtils log module name overlapping with NetworkUtils class.
    - Fixed missing enum value for PacketLogModuleSll2Layer.
    Dimi1010 committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    45115e3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dfb98c5 View commit details
    Browse the repository at this point in the history
  3. Cleanup and fixes.

    Dimi1010 committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    9062c48 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1e856f0 View commit details
    Browse the repository at this point in the history
  5. Fixed wrong variable name.

    Dimi1010 committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    02618fc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    32ff8f9 View commit details
    Browse the repository at this point in the history
  7. Lint.

    Dimi1010 committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    12492d2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f21f85d View commit details
    Browse the repository at this point in the history
  9. Fixed extra /

    Dimi1010 committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    0faf2e8 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2024

  1. Configuration menu
    Copy the full SHA
    ae72e81 View commit details
    Browse the repository at this point in the history
  2. Fixed explicit warning.

    Dimi1010 committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    43d7b1c View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. Configuration menu
    Copy the full SHA
    87042f5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be95ab8 View commit details
    Browse the repository at this point in the history
  3. Revert "Moved log functions inside logger."

    This reverts commit be95ab8.
    Dimi1010 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    4b21a99 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Configuration menu
    Copy the full SHA
    00034e9 View commit details
    Browse the repository at this point in the history
  2. Moved the log functions to the Logger class.

    - Added optional compile time elimination of log calls below set level.
    Dimi1010 committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    b2055c0 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2024

  1. Configuration menu
    Copy the full SHA
    cfc3d56 View commit details
    Browse the repository at this point in the history
  2. Fixed typo in macro names.

    Dimi1010 committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    ac2a383 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3776653 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    76079a7 View commit details
    Browse the repository at this point in the history
  5. Reverted to previous optimizations to keep executable binary size low.

    - Renamed printLogMessage to emit and changed visibility to public.
    - Added new class LogContext to encapsulate a single emittable log message.
    - Added new methods createLogContext which is practically a rework of internalCreateLogStream but returns a LogContext.
    - Added optional use of object pooling optimization for reusing log contexts. (Enabled via preprocessor flag PCPP_LOG_USE_OBJECT_POOL)
    Dimi1010 committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    52b9007 View commit details
    Browse the repository at this point in the history
  6. Fixed warnings about unreferenced local variables if the compile time…

    … minimum log level set to too high severity..
    Dimi1010 committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    c71dd27 View commit details
    Browse the repository at this point in the history
  7. Removed useless variable.

    Dimi1010 committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    803c98a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9d44f76 View commit details
    Browse the repository at this point in the history
  9. Fixed variable assignment.

    Dimi1010 committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    af63a9b View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2024

  1. Added method useContextPooling to control if the logger should use co…

    …ntext pooling.
    
    - Removed preprocessor variable PCPP_LOG_USE_OBJECT_POOL.
    - Disabled context pooling for the unit tests as it interferes with the memory leak checker.
    Dimi1010 committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    02e717a View commit details
    Browse the repository at this point in the history
  2. Fixed more warnings about unreferenced local variables if the compile…

    … time minimum log level set to too high severity..
    Dimi1010 committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    3410231 View commit details
    Browse the repository at this point in the history
  3. Addressed warnings and documentation.

    - Added documentation to new methods and classes.
    - Addressed explicit constructor warnings.
    - Moved disable of context pooling for unit tests to the main.cpp files of the respective tests.
    Dimi1010 committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    379c074 View commit details
    Browse the repository at this point in the history
  4. Fixed include.

    Dimi1010 committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    bc82caf View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. Fixed pointer dereference.

    Dimi1010 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    69aa615 View commit details
    Browse the repository at this point in the history
  2. Fixed memory checker issues with logger.

    - Added 2 preallocated log contexts to the object pool.
    Dimi1010 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    17ec9a2 View commit details
    Browse the repository at this point in the history
  3. Lint

    Dimi1010 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    2029b4b View commit details
    Browse the repository at this point in the history
  4. Added mutex lock on the default log printer to support proper multi-t…

    …hreading and eliminate possibility of data races during log emission.
    Dimi1010 committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    c09a11a View commit details
    Browse the repository at this point in the history