# Miscellaneous Modules

{% hint style="info" %}
This API Reference is based on PySDK 0.20.0.
{% endhint %}

## degirum.log.DGLog

Console logging class with programmable verbosity.

## print(message) <a href="#degirum.log.dglog.print" id="degirum.log.dglog.print"></a>

`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) <a href="#degirum.log.dglog.set_verbose_state" id="degirum.log.dglog.set_verbose_state"></a>

`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* |

## degirum.log.async\_log\_wrap(f=None, \*, log\_level=logging.DEBUG)

{% code overflow="wrap" %}

```
async_log_wrap(f: Callable[P, Awaitable[R]]) -> Callable[P, Awaitable[R]]
```

{% endcode %}

{% code overflow="wrap" %}

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

{% endcode %}

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` |

## degirum.log.log\_wrap(f=None, \*, log\_level=logging.DEBUG)

{% code overflow="wrap" %}

```
log_wrap(f: Callable[P, R]) -> Callable[P, R]
```

{% endcode %}

{% code overflow="wrap" %}

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

{% endcode %}

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` |

## degirum.exceptions.DegirumException

Bases: `Exception`

Base type for all DeGirum exceptions.

## degirum.exceptions.validate\_color\_tuple(color)

Validate if color has acceptable representation.

Parameters:

| Name    | Type  | Description               | Default    |
| ------- | ----- | ------------------------- | ---------- |
| `color` | `Any` | Color object to validate. | *required* |

Raises:

| Type                                                       | Description                                                               |
| ---------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`DegirumException`](#degirum.exceptions.DegirumException) | if color is not a three-element tuple and each element is integer number. |

Returns:

| Type    | Description                        |
| ------- | ---------------------------------- |
| `tuple` | color sequence converted to tuple. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/misc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
