From 3ea36a1d9351c1f0fb1dd39d682205e677a8fb79 Mon Sep 17 00:00:00 2001 From: Michael Reichenbach Date: Tue, 9 Mar 2021 07:05:37 +0100 Subject: [PATCH] feat: add debug logging to mydumper --- src/restic_compose_backup/containers_db.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/restic_compose_backup/containers_db.py b/src/restic_compose_backup/containers_db.py index b1aa6af..39b7e5d 100644 --- a/src/restic_compose_backup/containers_db.py +++ b/src/restic_compose_backup/containers_db.py @@ -36,6 +36,11 @@ class MariadbContainer(Container): """list: create a dump command restic and use to send data through stdin""" creds = self.get_credentials() destination = self.backup_destination_path() + + verbosity = 2 + if self.get_config.log_level == 'debug': + verbosity = 3 + return [ "mydumper", "--user", @@ -51,7 +56,9 @@ class MariadbContainer(Container): "--no-views", "--compress", "--regex", - "'^(?!(mysql\.))'" + "'^(?!(mysql\.))'", + "--verbose", + f"{verbosity}" ] def backup(self): @@ -111,6 +118,11 @@ class MysqlContainer(Container): """list: create a dump command restic and use to send data through stdin""" creds = self.get_credentials() destination = self.backup_destination_path() + + verbosity = 2 + if self.get_config.log_level == 'debug': + verbosity = 3 + return [ "mydumper", "--user", @@ -126,7 +138,9 @@ class MysqlContainer(Container): "--no-views", "--compress", "--regex", - "'^(?!(mysql\.))'" + "'^(?!(mysql\.))'", + "--verbose", + f"{verbosity}" ] def backup(self):