新增:release版本日志打印开关

This commit is contained in:
ivan 2026-04-28 11:20:07 +08:00
parent 8455c3946b
commit cd6a9ade0a
3 changed files with 20 additions and 6 deletions

View File

@ -2,8 +2,18 @@ import 'package:flutter/foundation.dart';
/// petsHeroAI API /// petsHeroAI API
abstract final class ApiConfig { abstract final class ApiConfig {
/// true release debug/info线 false ///
static const bool debugLogs = false; /// `flutter run --release --dart-define=APP_LOG_LEVEL=trace`
/// `trace` / `debug` / `verbose` release [AppLogger]
static const String appLogLevel =
String.fromEnvironment('APP_LOG_LEVEL', defaultValue: '');
/// debug release [appLogLevel] trace/debug/verbose true
static bool get debugLogs {
if (kDebugMode) return true;
final l = appLogLevel.toLowerCase();
return l == 'trace' || l == 'debug' || l == 'verbose';
}
/// AES /// AES
static const String aesKey = 'liyP4LkMfP68XvCt'; static const String aesKey = 'liyP4LkMfP68XvCt';

View File

@ -1,9 +1,13 @@
import 'package:flutter/foundation.dart';
import '../api/api_config.dart';
/// Facebook SDK /// Facebook SDK
/// ///
/// Adjust Meta Install Referrer Facebook App Events /// Adjust Meta Install Referrer Facebook App Events
abstract final class FacebookConfig { abstract final class FacebookConfig {
/// Facebook true Dart FB 线 false /// Dart FB debug `--dart-define=APP_LOG_LEVEL=trace` true
static const bool debugLogs = true; static bool get debugLogs => kDebugMode || ApiConfig.debugLogs;
/// Facebook ID /// Facebook ID
static const String appId = '1684216162986495'; static const String appId = '1684216162986495';

View File

@ -6,8 +6,8 @@ import '../api/api_config.dart';
/// ///
/// ///
/// [Logger] [DevelopmentFilter] `assert` release/profile **** /// [Logger] [DevelopmentFilter] `assert` release/profile ****
/// [ApiConfig.debugLogs]=true [ProductionFilter] debug/info /// Release `flutter run --release --dart-define=APP_LOG_LEVEL=trace` [ApiConfig.debugLogs]
/// release debugLogs=false warning filter /// 使 [ProductionFilter]debug/info
/// ///
/// 使: /// 使:
/// final _log = AppLogger('GenerateVideo'); /// final _log = AppLogger('GenerateVideo');