mirror of
https://github.com/ep1cman/unifi-protect-backup.git
synced 2025-12-24 04:04:44 +00:00
Log buffer size in human readable format
This commit is contained in:
@@ -14,7 +14,13 @@ from pyunifiprotect import ProtectApiClient
|
|||||||
from pyunifiprotect.data.types import ModelType
|
from pyunifiprotect.data.types import ModelType
|
||||||
|
|
||||||
from unifi_protect_backup import EventListener, MissingEventChecker, Purge, VideoDownloader, VideoUploader
|
from unifi_protect_backup import EventListener, MissingEventChecker, Purge, VideoDownloader, VideoUploader
|
||||||
from unifi_protect_backup.utils import SubprocessException, parse_rclone_retention, run_command, setup_logging
|
from unifi_protect_backup.utils import (
|
||||||
|
SubprocessException,
|
||||||
|
parse_rclone_retention,
|
||||||
|
run_command,
|
||||||
|
setup_logging,
|
||||||
|
human_readable_size,
|
||||||
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -99,7 +105,7 @@ class UnifiProtectBackup:
|
|||||||
logger.debug(f" {detection_types=}")
|
logger.debug(f" {detection_types=}")
|
||||||
logger.debug(f" {file_structure_format=}")
|
logger.debug(f" {file_structure_format=}")
|
||||||
logger.debug(f" {sqlite_path=}")
|
logger.debug(f" {sqlite_path=}")
|
||||||
logger.debug(f" {download_buffer_size=}")
|
logger.debug(f" download_buffer_size={human_readable_size(download_buffer_size)}")
|
||||||
|
|
||||||
self.rclone_destination = rclone_destination
|
self.rclone_destination = rclone_destination
|
||||||
self.retention = parse_rclone_retention(retention)
|
self.retention = parse_rclone_retention(retention)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import aiosqlite
|
|||||||
from pyunifiprotect.data.nvr import Event
|
from pyunifiprotect.data.nvr import Event
|
||||||
from pyunifiprotect import ProtectApiClient
|
from pyunifiprotect import ProtectApiClient
|
||||||
|
|
||||||
from unifi_protect_backup.utils import get_camera_name, VideoQueue, run_command, setup_event_logger
|
from unifi_protect_backup.utils import get_camera_name, VideoQueue, run_command, setup_event_logger, human_readable_size
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
setup_event_logger(logger)
|
setup_event_logger(logger)
|
||||||
@@ -50,7 +50,9 @@ class VideoUploader:
|
|||||||
self.logger = logging.LoggerAdapter(logger, {'event': f' [{event.id}]'})
|
self.logger = logging.LoggerAdapter(logger, {'event': f' [{event.id}]'})
|
||||||
|
|
||||||
self.logger.info(f"Uploading event: {event.id}")
|
self.logger.info(f"Uploading event: {event.id}")
|
||||||
self.logger.debug(f" Remaining Upload Queue: {self._video_queue.qsize_files()}")
|
self.logger.debug(
|
||||||
|
f" Remaining Upload Queue: {self.upload_queue.qsize_files()} ({human_readable_size(self.upload_queue.qsize())})"
|
||||||
|
)
|
||||||
|
|
||||||
destination = await self._generate_file_path(event)
|
destination = await self._generate_file_path(event)
|
||||||
self.logger.debug(f" Destination: {destination}")
|
self.logger.debug(f" Destination: {destination}")
|
||||||
|
|||||||
Reference in New Issue
Block a user