Home Assistant Unofficial Reference 2024.12.1
homeassistant.util.logging Namespace Reference

Classes

class  HomeAssistantQueueHandler
 

Functions

Coroutine[Any, Any, _T|None] _T (Coroutine[Any, Any, _T] target)
 
None _Ts (Callable[[*_Ts], Any] format_err, **_Ts args)
 
None _Ts (Callable[[*_Ts], Any] func, Callable[[*_Ts], Any] format_err, **_Ts args)
 
Callable[[ *_Ts], None]|Callable[[ *_Ts], Coroutine[Any, Any, None]] _Ts (Callable[[*_Ts], Any] func, Callable[[*_Ts], Any] format_err, HassJobType|None job_type=None)
 
Callable[[ *_Ts], Coroutine[Any, Any, None]] _Ts (Callable[[*_Ts], Coroutine[Any, Any, Any]] func, Callable[[*_Ts], Any] format_err, HassJobType|None job_type=None)
 
None _Ts (Callable[[*_Ts], Coroutine[Any, Any, None]] async_func, Callable[[*_Ts], Any] format_err, **_Ts args)
 
Coroutine[Any, Any, _T|None] _Ts (Coroutine[Any, Any, _T] target, Callable[[*_Ts], Any] format_err, **_Ts args)
 
None async_activate_log_queue_handler (HomeAssistant hass)
 

Detailed Description

Logging utilities.

Function Documentation

◆ _T()

Coroutine[Any, Any, _T | None] homeassistant.util.logging._T ( Coroutine[Any, Any, _T]  target)
private
Wrap a coroutine to catch and log exceptions.

The exception will be logged together with a stacktrace of where the
coroutine was wrapped.

target: target coroutine.

Definition at line 186 of file logging.py.

◆ _Ts() [1/6]

None homeassistant.util.logging._Ts ( Callable[[*_Ts], Any]  format_err,
**_Ts  args 
)
private
Log an exception with additional context.

Definition at line 80 of file logging.py.

◆ _Ts() [2/6]

None homeassistant.util.logging._Ts ( Callable[[*_Ts], Any]  func,
Callable[[*_Ts], Any]  format_err,
**_Ts   args 
)
private
Catch and log exception.

Definition at line 110 of file logging.py.

◆ _Ts() [3/6]

Callable[[*_Ts], None] | Callable[[*_Ts], Coroutine[Any, Any, None]] homeassistant.util.logging._Ts ( Callable  [[*_Ts],
Any]  func,
Callable  [[*_Ts],
Any]  format_err,
HassJobType|None  job_type = None 
)
private
Decorate a function func to catch and log exceptions.

If func is a coroutine function, a coroutine function will be returned.
If func is a callback, a callback will be returned.

Definition at line 140 of file logging.py.

◆ _Ts() [4/6]

Callable[[*_Ts], Coroutine[Any, Any, None]] homeassistant.util.logging._Ts ( Callable[[*_Ts], Coroutine[Any, Any, Any]]  func,
Callable[[*_Ts], Any]  format_err,
HassJobType | None   job_type = None 
)
private

Definition at line 132 of file logging.py.

◆ _Ts() [5/6]

None homeassistant.util.logging._Ts ( Callable[[*_Ts], Coroutine[Any, Any, None]]  async_func,
Callable[[*_Ts], Any]  format_err,
**_Ts  args 
)
private
Catch and log exception.

Definition at line 98 of file logging.py.

◆ _Ts() [6/6]

Coroutine[Any, Any, _T | None] homeassistant.util.logging._Ts ( Coroutine[Any, Any, _T target,
Callable[[*_Ts], Any]  format_err,
**_Ts   args 
)
private
Decorate a coroutine to catch and log exceptions.

Definition at line 170 of file logging.py.

◆ async_activate_log_queue_handler()

None homeassistant.util.logging.async_activate_log_queue_handler ( HomeAssistant  hass)
Migrate the existing log handlers to use the queue.

This allows us to avoid blocking I/O and formatting messages
in the event loop as log messages are written in another thread.

Definition at line 57 of file logging.py.