×


Serenity Documentation





The serenity namespace is the top-level all encompassing namespace of the library itself.

This namespace contains the following:

Classes/Structs:
  • MsgWithLoc - This struct is used to capture source location information at a log call site as well as implicitly convert text encodings into UTF-8 by default to be used internally

  • BackgroundThread - This class allows Serenity's targets to flush the contents of the buffer being used independently of the logging thread(s) in a thread-safe manner.

  • Flush_Policy - This class controls whether the logger should flush on a specified interval, always, or never

  • FileCache - This class aids in caching the current log file, including its absolute path, directory, file name, and file extension.

  • PeriodicSettings - This class specifies the options for Flush_Policy (options being time-based interval, always, or never)

  • RotateLimits - This class holds the options used to specify the RotatingTarget behavior

  • RotateSettings - This class encapsulates RotateLimits and FileHelper into one class that RotatingTarget inherits from for their functionalities

Enums:
  • LineEnd - This enum is what maps the line ending applied to the log message based off the platform

  • LoggerLevel - LoggerLevel is what is applied to both the log message and the logger level threshold

  • source_flag - This enum is used as a bit flag of sorts for source location formatting

  • message_time_mode - Controls whether time is displayed as local time or UTC time

  • CustomErrors - This enum is what maps the custom_error_messages in ReportCustomError

Free Functions:
Nested Namespaces:
  • targets - This namespace contains the in-house logging targets


  • se_colors -This namespace handles ansi color codes and is meant to be an aid for the ConsoleTarget. It includes nested namespaces to separate the colors in an organized manner and make the intent of the color choices clear. This includes the following nested namespaces:

    • basic_colors - This namespace handles color codes for basic variants and contains the following nested namespaces
      • foreground
      • background
      • combos

    • bright_colors - This namespace handles color codes for bold/bright variants and contains the following nested namespaces
      • foreground
      • background
      • combos

    • Tag - This namespace handles the function-equivalents for the above namespaces for easily wrapping text with specified colors

  • CustomFlagError - This namespace handles error reporting for the custom template specializations for LoggerLevel and std::tm


  • msg_details
    - This namespace holds the classes that comprise mostly everything about a log message

    • custom_flags - This nested namespace holds the classes involved with the custom formatter specializations

      • Format_Source_Loc - This class is a helper class used in formatting source location data

      • format_thread_id - This class is a helper class used in formatting thread ID and its length


    • Message_Formatter - This class controls the storage of the log output format and the locale used

    • Message_Info - This class contains functions and values relevant to the payload of the log message, such as a time reference, logger name, etc

    • Message_Time - This class controls caching and updating time-related info used in the log message

    • ZoneThread - This class controls how the background thread checks for daylight savings and notifies whether or not the cached time values needs to be updated to reflect any changes


  • SERENITY_LUTS - This namespace holds all the lookup tables used in this library

    • line_ending - Maps the platform detected to the end-of-line value that should be appended to the end of each log message

    • daysPerMonth - Maps how many days are in each month for the RotatingTarget

    • This namespace also holds these constexpr variables used in the daysPerMonth lookup table:

      • JANUARY = 0
      • FEBRUARY = 1
      • MARCH = 2
      • APRIL = 3
      • MAY = 4
      • JUNE = 5
      • JULY = 6
      • AUGUST = 7
      • SEPTEMBER = 8
      • OCTOBER = 9
      • NOVEMBER = 10
      • DECEMBER = 11