From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 86D391FF0AA for ; Fri, 21 Aug 2026 15:07:58 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AE7092161B; Fri, 21 Aug 2026 15:07:40 +0200 (CEST) From: Shan Shaji To: pve-devel@lists.proxmox.com Subject: [PATCH pve_flutter_frontend 1/1] cleanup: remove print statements Date: Fri, 21 Aug 2026 15:07:16 +0200 Message-ID: <20260821130718.330515-2-s.shaji@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260821130718.330515-1-s.shaji@proxmox.com> References: <20260821130718.330515-1-s.shaji@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787317620047 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.560 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_SHORT 0.001 Use of a URL Shortener for very short URL RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UHLGLIV4WT55WYKOWSKAUF2T6FYLR6MO X-Message-ID-Hash: UHLGLIV4WT55WYKOWSKAUF2T6FYLR6MO X-MailFrom: s.shaji@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Dart Linter rules recommend avoiding print statements [0]. To align with this, surround the print calls with the kDebugMode constant. - [0] https://dart.dev/tools/linter-rules/avoid_print Signed-off-by: Shan Shaji --- analysis_options.yaml | 1 - lib/bloc/proxmox_base_bloc.dart | 8 +++++--- lib/bloc/pve_file_selector_bloc.dart | 5 ++++- lib/widgets/pve_console_menu_widget.dart | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 97fc1a8..b8bb85a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -21,7 +21,6 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: - avoid_print: false library_private_types_in_public_api: false # we need to fix use of our PveBaseState mixin first # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule diff --git a/lib/bloc/proxmox_base_bloc.dart b/lib/bloc/proxmox_base_bloc.dart index c01ade1..32d116e 100644 --- a/lib/bloc/proxmox_base_bloc.dart +++ b/lib/bloc/proxmox_base_bloc.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:meta/meta.dart'; +import 'package:flutter/foundation.dart'; import 'package:pve_flutter_frontend/bloc/proxmox_global_error_bloc.dart'; import 'package:rxdart/rxdart.dart'; @@ -55,8 +55,10 @@ abstract class ProxmoxBaseBloc { void _errorHandler(Object error, [StackTrace? stacktrace]) { ProxmoxGlobalErrorBloc().addError(error); - print(error); - print(stacktrace); + if (kDebugMode) { + print(error); + print(stacktrace); + } } @mustCallSuper diff --git a/lib/bloc/pve_file_selector_bloc.dart b/lib/bloc/pve_file_selector_bloc.dart index ed78ac4..83dada7 100644 --- a/lib/bloc/pve_file_selector_bloc.dart +++ b/lib/bloc/pve_file_selector_bloc.dart @@ -1,6 +1,7 @@ import 'package:pve_flutter_frontend/bloc/proxmox_base_bloc.dart'; import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart'; import 'package:pve_flutter_frontend/states/pve_file_selector_state.dart'; +import 'package:flutter/foundation.dart'; class PveFileSelectorBloc extends ProxmoxBaseBloc { @@ -48,7 +49,9 @@ class PveFileSelectorBloc latestState.nodeID, latestState.storageID!, event.volume!, delay: 5); } on ProxmoxApiException catch (e) { - print(e); + if (kDebugMode) { + print(e); + } } events.add(LoadStorageContent()); } diff --git a/lib/widgets/pve_console_menu_widget.dart b/lib/widgets/pve_console_menu_widget.dart index 86feac8..68364e7 100644 --- a/lib/widgets/pve_console_menu_widget.dart +++ b/lib/widgets/pve_console_menu_widget.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:path_provider/path_provider.dart'; @@ -259,7 +260,9 @@ class PVEWebConsoleState extends State { await settings .rebuild((b) => b..trustedFingerprints.add(hash)) .toLocalStorage(); - print(settings.toJson()); + if (kDebugMode) { + print(settings.toJson()); + } } final action = trust -- 2.47.3