Miscellaneous Modules

PySDK API Reference Guide. Console logging, verbosity control and helper exceptions.

This API Reference is based on PySDK 0.17.2.

Console logging class with programmable verbosity.

print(message)

degirum.log.DGLog.print(message)

staticmethod

Print message to log according to current verbosity level.

Parameters:

Name
Type
Description
Default

message

str

Message string to print.

required

set_verbose_state(state)

degirum.log.DGLog.set_verbose_state(state)

staticmethod

Set log verbosity state.

Parameters:

Name
Type
Description
Default

state

bool

If True, then log prints messages to console, otherwise no messages printed.

required

async_log_wrap(f: Callable[P, Awaitable[R]]) -> Callable[P, Awaitable[R]]
async_log_wrap(*, log_level: int = logging.DEBUG) -> Callable[[Callable[P, Awaitable[R]]], Callable[P, Awaitable[R]]]

Decorator to log async function entry and exit with execution time.

Parameters:

Name
Type
Description
Default

f

Callable

Async function to log.

None

log_level

int

Logging level of the log entries.

DEBUG

log_wrap(f: Callable[P, R]) -> Callable[P, R]
log_wrap(*, log_level: int = logging.DEBUG) -> Callable[[Callable[P, R]], Callable[P, R]]

Decorator to log function entry and exit with execution time.

Parameters:

Name
Type
Description
Default

f

Callable

Sync function to log

None

log_level

int

Logging level of the log entries.

DEBUG

Bases: Exception

Base type for all DeGirum exceptions.

Validate if color has acceptable representation.

Parameters:

Name
Type
Description
Default

color

Any

Color object to validate.

required

Raises:

Type
Description

if color is not a three-element tuple and each element is integer number.

Returns:

Type
Description

tuple

color sequence converted to tuple.

Last updated

Was this helpful?