> For the complete documentation index, see [llms.txt](https://docs.degirum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/misc.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
