kim-api  2.3.1-git+v2.3.0-git-2-g378406f9.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Public Member Functions | Static Public Member Functions | List of all members
KIM::Log Class Reference

Provides the logging interface for the KIM API. More...

#include <KIM_Log.hpp>

Public Member Functions

std::string const & GetID () const
 Get the identity of the Log object. More...
 
void SetID (std::string const &id)
 Set the identity of the Log object. More...
 
void PushVerbosity (LogVerbosity const logVerbosity)
 Push a new LogVerbosity onto the Log object's verbosity stack. More...
 
void PopVerbosity ()
 Pop a LogVerbosity from the Log object's verbosity stack. More...
 
void LogEntry (LogVerbosity const logVerbosity, std::string const &message, int const lineNumber, std::string const &fileName) const
 Write a log entry into the log file. More...
 
void LogEntry (LogVerbosity const logVerbosity, std::stringstream const &message, int const lineNumber, std::string const &fileName) const
 

Static Public Member Functions

static int Create (Log **const log)
 Create a new KIM API Log object. More...
 
static void Destroy (Log **const log)
 Destroy a previously Log::Create'd object. More...
 
static void PushDefaultVerbosity (LogVerbosity const logVerbosity)
 Push a new default LogVerbosity onto the KIM API global default verbosity stack. More...
 
static void PopDefaultVerbosity ()
 Pop a LogVerbosity from the KIM API global default verbosity stack. More...
 
static void PushDefaultPrintFunction (LanguageName const languageName, Function *const fptr)
 Push a new default log PrintFunction onto the KIM API global default log PrintFunction stack. More...
 
static void PopDefaultPrintFunction ()
 Pop a log PrintFunction from the KIM API global default log PrintFunction stack. More...
 

Detailed Description

Provides the logging interface for the KIM API.

See also
KIM_Log, kim_log_module::kim_log_handle_type
Since
2.0

Definition at line 53 of file KIM_Log.hpp.

Member Function Documentation

◆ Create()

static int KIM::Log::Create ( Log **const  log)
static

Create a new KIM API Log object.

Parameters
[out]logPointer to the newly created Log object.
Returns
false
See also
KIM_Log_Create, kim_log_module::kim_log_create
Since
2.0

◆ Destroy()

static void KIM::Log::Destroy ( Log **const  log)
static

Destroy a previously Log::Create'd object.

Parameters
[in,out]logPointer to the Log object.
Precondition
log points to a previously created KIM API Log object.
Postcondition
log == NULL.
See also
KIM_Log_Destroy, kim_log_module::kim_log_destroy
Since
2.0

◆ GetID()

std::string const& KIM::Log::GetID ( ) const

Get the identity of the Log object.

See also
KIM_Log_GetID, kim_log_module::kim_get_id
Since
2.0

◆ LogEntry() [1/2]

void KIM::Log::LogEntry ( LogVerbosity const  logVerbosity,
std::string const &  message,
int const  lineNumber,
std::string const &  fileName 
) const

Write a log entry into the log file.

This results in a no-op if logVerbosity is LOG_VERBOSITY::silent or if logVerbosity is greater-than the Log object's top LogVerbosity on its stack.

Parameters
[in]logVerbosityThe LogVerbosity level for the entry.
[in]messageThe body text of the log entry.
[in]lineNumberThe source code file line number.
[in]fileNameThe source code file name.
See also
KIM_Log_LogEntry, kim_log_module::kim_log_entry
Since
2.0

◆ LogEntry() [2/2]

void KIM::Log::LogEntry ( LogVerbosity const  logVerbosity,
std::stringstream const &  message,
int const  lineNumber,
std::string const &  fileName 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ PopDefaultPrintFunction()

static void KIM::Log::PopDefaultPrintFunction ( )
static

Pop a log PrintFunction from the KIM API global default log PrintFunction stack.

See also
KIM_Log_PopDefaultPrintFunction, kim_log_module::kim_pop_default_print_function
Since
2.2

◆ PopDefaultVerbosity()

static void KIM::Log::PopDefaultVerbosity ( )
static

Pop a LogVerbosity from the KIM API global default verbosity stack.

See also
KIM_Log_PopDefaultVerbosity, kim_log_module::kim_pop_default_verbosity
Since
2.0

◆ PopVerbosity()

void KIM::Log::PopVerbosity ( )

Pop a LogVerbosity from the Log object's verbosity stack.

See also
KIM_Log_PopVerbosity, kim_log_module::kim_pop_verbosity
Since
2.0

◆ PushDefaultPrintFunction()

static void KIM::Log::PushDefaultPrintFunction ( LanguageName const  languageName,
Function *const  fptr 
)
static

Push a new default log PrintFunction onto the KIM API global default log PrintFunction stack.

The default log PrintFunction is used when creating new Log objects.

Parameters
[in]languageNameThe LanguageName of the function.
[in]fptrThe function pointer.
See also
KIM_Log_PushDefaultPrintFunction, kim_log_module::kim_push_default_print_function
Since
2.2

◆ PushDefaultVerbosity()

static void KIM::Log::PushDefaultVerbosity ( LogVerbosity const  logVerbosity)
static

Push a new default LogVerbosity onto the KIM API global default verbosity stack.

The default LogVerbosity is used when creating new Log objects.

Parameters
[in]logVerbosityA LogVerbosity value.
See also
KIM_Log_PushDefaultVerbosity, kim_log_module::kim_push_default_verbosity
Since
2.0

◆ PushVerbosity()

void KIM::Log::PushVerbosity ( LogVerbosity const  logVerbosity)

Push a new LogVerbosity onto the Log object's verbosity stack.

Parameters
[in]logVerbosityA LogVerbosity value.
See also
KIM_Log_PushVerbosity, kim_log_module::kim_push_verbosity
Since
2.0

◆ SetID()

void KIM::Log::SetID ( std::string const &  id)

Set the identity of the Log object.

Parameters
[in]idString identifying the Log object.
See also
KIM_Log_SetID, kim_log_module::kim_set_id
Since
2.0

The documentation for this class was generated from the following file: