Class RequirementsLogger#

Nested Relationships#

Nested Types#

Class Documentation#

class RequirementsLogger#

Collects requirement outcomes and writes one process JSON artifact.

Logging is disabled unless KARANA_LOG_REQUIREMENTS is present in the process environment.

The first call to singleton() registers automatic artifact emission with the standard process-exit callback registry.

Public Functions

void logRequirement(const Requirement &requirement, Status status)#

Record one requirement verification.

Parameters:
  • requirement – Authored requirement identifier.

  • status – Verification outcome.

Throws:

std::logic_error – If status is not a declared enumerator.

void logRequirement(const Requirement &requirement, bool passed)#

Record a passed or failed requirement verification from a boolean check.

Parameters:
  • requirement – Authored requirement identifier.

  • passed – True maps to PASSED and false maps to FAILED; SKIPPED remains explicit.

int getReturnCode()#

Return the process status implied by recorded requirement outcomes.

Returns:

One after any FAILED outcome, otherwise zero.

void setArtifactDirectory(std::filesystem::path directory)#

Override the directory used for automatic artifact emission.

Parameters:

directory – Destination directory, created during process exit.

void setLanguage(std::string language)#

Set the implementation language represented by this process.

Parameters:

language – Stable language identifier written to the artifact.

Throws:

std::invalid_argument – If language is empty.

RequirementsLogger(const RequirementsLogger&) = delete#
RequirementsLogger &operator=(const RequirementsLogger&) = delete#

Public Static Functions

static std::shared_ptr<RequirementsLogger> singleton()#

Return a process-wide requirements logger.

Returns:

Shared pointer to the singleton process logger.