Senzing C++ SDK
C++ SDK for Senzing v4, patterned after the official C# SDK
Loading...
Searching...
No Matches
senzing::sdk Namespace Reference

Namespaces

namespace  core
namespace  detail

Classes

class  SzConfig
 In-memory Senzing configuration document. More...
class  SzConfigManager
 Manages persisted Senzing configurations and the default config registry. More...
class  SzDiagnostic
 Diagnostic operations against the Senzing repository. More...
class  SzEngine
 The core Senzing entity-resolution engine. More...
class  SzEnvironment
 Factory + lifecycle for the Senzing SDK subsystems. More...
class  SzException
 Base exception for all Senzing engine errors. More...
class  SzEnvironmentDestroyedException
 Thrown when an SzEnvironment (or a subsystem it owns) is used after Destroy(). More...
class  SzLogOutput
 Destination of native's default output. More...
class  SzLogCallbackOptions
 Registration parameters: the callback's minimum level and the format native applies to SzLogRecord::Message(). More...
struct  SzLogEntry
 An owned copy of an SzLogRecord, for queues and buffers. More...
class  SzLogRecord
 One log message, borrowed from native for the duration of a callback. More...
class  SzLogRegistration
 A live native callback registration, owned through std::unique_ptr (so it is move-only). More...
class  SzLogCapture
 Collects the records logged on the thread that created it until Finish(). More...
class  SzLogging
 Senzing native logging (libSzLogging). More...
class  SzProduct
 Provides access to the Senzing product version and license metadata. More...

Typedefs

using SzExportHandle = std::uintptr_t
 Opaque export-report handle, mirroring the C# IntPtr.
using SzLogCallback = std::function<void(const SzLogRecord&)>
 A log callback.

Enumerations

enum class  SzLogLevel : int32_t {
  Trace = 0 , Debug = 1 , Info = 2 , Warn = 3 ,
  Error = 4 , Critical = 5 , Off = 6
}
 Log severity. More...
enum class  SzLogFormat : int32_t { Legacy = 0 , Jsonl = 1 , Bare = 2 , Default = 3 }
 Message format, applied by native (SZ_LOG_FORMAT_*). More...
enum class  SzLogOutputType : int32_t {
  Stderr = 0 , Stdout = 1 , File = 2 , Null = 3 ,
  Callback = 4
}
 The kind of destination of native's default output (SZ_LOG_OUTPUT_*). More...

Functions

 SENZING_SDK_DECLARE_EXCEPTION (SzBadInputException, SzException)
 SENZING_SDK_DECLARE_EXCEPTION (SzConfigurationException, SzException)
 SENZING_SDK_DECLARE_EXCEPTION (SzReplaceConflictException, SzException)
 SENZING_SDK_DECLARE_EXCEPTION (SzRetryableException, SzException)
 SENZING_SDK_DECLARE_EXCEPTION (SzUnrecoverableException, SzException)
 SENZING_SDK_DECLARE_EXCEPTION (SzNotFoundException, SzBadInputException)
 SENZING_SDK_DECLARE_EXCEPTION (SzUnknownDataSourceException, SzBadInputException)
 SENZING_SDK_DECLARE_EXCEPTION (SzDatabaseConnectionLostException, SzRetryableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzDatabaseTransientException, SzRetryableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzRetryTimeoutExceededException, SzRetryableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzDatabaseException, SzUnrecoverableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzLicenseException, SzUnrecoverableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzNotInitializedException, SzUnrecoverableException)
 SENZING_SDK_DECLARE_EXCEPTION (SzUnhandledException, SzUnrecoverableException)
constexpr std::string_view ToString (SzLogLevel level) noexcept
 The canonical upper-case name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL" or "OFF" ("UNKNOWN" for a value outside the enum).
constexpr std::string_view ToString (SzLogFormat format) noexcept
 The canonical upper-case name: "LEGACY", "JSONL", "BARE" or "DEFAULT" ("UNKNOWN" for a value outside the enum).
std::ostream & operator<< (std::ostream &os, SzLogLevel level)
 Writes ToString(level).
std::ostream & operator<< (std::ostream &os, SzLogFormat format)
 Writes ToString(format).
SzLogLevel ParseSzLogLevel (std::string_view text)
 Parses a level name.
SzLogFormat ParseSzLogFormat (std::string_view text)
 Parses a format name.
std::ostream & operator<< (std::ostream &os, const SzLogEntry &entry)
 Writes entry.Message (the message as native formatted it).
std::ostream & operator<< (std::ostream &os, const SzLogRecord &record)
 Writes record.Message() (the message as native formatted it).

Variables

constexpr std::array< SzLogLevel, 7 > SzLogLevels
 All levels, most verbose first.
constexpr std::array< SzLogFormat, 4 > SzLogFormats
 All formats.

Typedef Documentation

◆ SzExportHandle

using senzing::sdk::SzExportHandle = std::uintptr_t

Opaque export-report handle, mirroring the C# IntPtr.

The raw native handle is exposed deliberately (no RAII wrapper) so the surface matches C#; callers must pass it to CloseExportReport.

◆ SzLogCallback

using senzing::sdk::SzLogCallback = std::function<void(const SzLogRecord&)>

A log callback.

Accepts any callable (lambda, function, functor). It may be invoked concurrently from several threads; exceptions it throws are caught and discarded at the native boundary.

Enumeration Type Documentation

◆ SzLogFormat

enum class senzing::sdk::SzLogFormat : int32_t
strong

Message format, applied by native (SZ_LOG_FORMAT_*).

Enumerator
Legacy 

YYYY-MM-DD HH:MM:SS.mmm [module:hash] SEV: msg, in local time.

Jsonl 

One JSON object per line: timestamp, module, severity, message.

4.5.0 writes a local timestamp without a zone (UTC from Senzing >= 4.5.1).

Bare 

The message text only.

Default 

For the default output: spdlog's default pattern [YYYY-MM-DD HH:MM:SS.mmm] [module] [level] msg (local time).

For a registered callback native delivers the message only, as Bare.

◆ SzLogLevel

enum class senzing::sdk::SzLogLevel : int32_t
strong

Log severity.

The values are the native SZ_LOG_LEVEL_* values, ordered from most to least verbose, so level >= SzLogLevel::Warn reads naturally.

Native writes its own spellings, which differ from ToString(): JSONL severity is lower case (warning for Warn) and the Legacy tag is abbreviated (TRCE, DBUG, INFO, WARN, ERR, CRIT). ParseSzLogLevel() accepts warning.

Enumerator
Trace 

Most verbose: execution flow (SZ_LOG_LEVEL_TRACE).

Debug 

Debug information (SZ_LOG_LEVEL_DEBUG).

Info 

Informational messages (SZ_LOG_LEVEL_INFO).

Warn 

Warnings (SZ_LOG_LEVEL_WARN).

Error 

Errors (SZ_LOG_LEVEL_ERROR).

Critical 

Critical errors (SZ_LOG_LEVEL_CRITICAL).

Off 

Nothing is delivered (SZ_LOG_LEVEL_OFF).

A filter value only; never a record's level (a native record claiming OFF is dropped).

◆ SzLogOutputType

enum class senzing::sdk::SzLogOutputType : int32_t
strong

The kind of destination of native's default output (SZ_LOG_OUTPUT_*).

Enumerator
Stderr 

Standard error (the native default).

Stdout 

Standard output.

File 

A file opened by native (truncate or append).

Null 

Discard; only registered callbacks receive messages.

Callback 

A default callback is set.

Reported by SzLogging::GetDefaultOutput only; install one with SzLogging::SetDefaultCallback.

Function Documentation

◆ operator<<() [1/4]

std::ostream & senzing::sdk::operator<< ( std::ostream & os,
const SzLogEntry & entry )
inline

Writes entry.Message (the message as native formatted it).

◆ operator<<() [2/4]

std::ostream & senzing::sdk::operator<< ( std::ostream & os,
const SzLogRecord & record )
inline

Writes record.Message() (the message as native formatted it).

◆ operator<<() [3/4]

std::ostream & senzing::sdk::operator<< ( std::ostream & os,
SzLogFormat format )
inline

Writes ToString(format).

◆ operator<<() [4/4]

std::ostream & senzing::sdk::operator<< ( std::ostream & os,
SzLogLevel level )
inline

Writes ToString(level).

◆ ParseSzLogFormat()

SzLogFormat senzing::sdk::ParseSzLogFormat ( std::string_view text)
inlinenodiscard

Parses a format name.

Case-insensitive; surrounding whitespace is ignored and "json" is accepted for Jsonl. Throws SzBadInputException when the text names no format.

◆ ParseSzLogLevel()

SzLogLevel senzing::sdk::ParseSzLogLevel ( std::string_view text)
inlinenodiscard

Parses a level name.

Case-insensitive; surrounding whitespace is ignored and "warning" is accepted for Warn. Throws SzBadInputException when the text names no level.

◆ SENZING_SDK_DECLARE_EXCEPTION() [1/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzBadInputException ,
SzException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [2/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzConfigurationException ,
SzException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [3/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzDatabaseConnectionLostException ,
SzRetryableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [4/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzDatabaseException ,
SzUnrecoverableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [5/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzDatabaseTransientException ,
SzRetryableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [6/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzLicenseException ,
SzUnrecoverableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [7/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzNotFoundException ,
SzBadInputException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [8/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzNotInitializedException ,
SzUnrecoverableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [9/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzReplaceConflictException ,
SzException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [10/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzRetryableException ,
SzException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [11/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzRetryTimeoutExceededException ,
SzRetryableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [12/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzUnhandledException ,
SzUnrecoverableException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [13/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzUnknownDataSourceException ,
SzBadInputException  )

◆ SENZING_SDK_DECLARE_EXCEPTION() [14/14]

senzing::sdk::SENZING_SDK_DECLARE_EXCEPTION ( SzUnrecoverableException ,
SzException  )

◆ ToString() [1/2]

std::string_view senzing::sdk::ToString ( SzLogFormat format)
nodiscardconstexprnoexcept

The canonical upper-case name: "LEGACY", "JSONL", "BARE" or "DEFAULT" ("UNKNOWN" for a value outside the enum).

◆ ToString() [2/2]

std::string_view senzing::sdk::ToString ( SzLogLevel level)
nodiscardconstexprnoexcept

The canonical upper-case name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL" or "OFF" ("UNKNOWN" for a value outside the enum).

Variable Documentation

◆ SzLogFormats

std::array<SzLogFormat, 4> senzing::sdk::SzLogFormats
inlineconstexpr
Initial value:
{
@ Legacy
YYYY-MM-DD HH:MM:SS.mmm [module:hash] SEV: msg, in local time.
Definition SzLogging.hpp:165
@ Bare
The message text only.
Definition SzLogging.hpp:170
@ Jsonl
One JSON object per line: timestamp, module, severity, message.
Definition SzLogging.hpp:168
@ Default
For the default output: spdlog's default pattern [YYYY-MM-DD HH:MM:SS.mmm] [module] [level] msg (loca...
Definition SzLogging.hpp:174

All formats.

◆ SzLogLevels

std::array<SzLogLevel, 7> senzing::sdk::SzLogLevels
inlineconstexpr
Initial value:
{
@ Critical
Critical errors (SZ_LOG_LEVEL_CRITICAL).
Definition SzLogging.hpp:147
@ Info
Informational messages (SZ_LOG_LEVEL_INFO).
Definition SzLogging.hpp:144
@ Warn
Warnings (SZ_LOG_LEVEL_WARN).
Definition SzLogging.hpp:145
@ Error
Errors (SZ_LOG_LEVEL_ERROR).
Definition SzLogging.hpp:146
@ Debug
Debug information (SZ_LOG_LEVEL_DEBUG).
Definition SzLogging.hpp:143
@ Off
Nothing is delivered (SZ_LOG_LEVEL_OFF).
Definition SzLogging.hpp:150
@ Trace
Most verbose: execution flow (SZ_LOG_LEVEL_TRACE).
Definition SzLogging.hpp:142

All levels, most verbose first.