mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
cleanup
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import 'package:immich_mobile/domain/models/log.model.dart';
|
||||
|
||||
class LogConfig {
|
||||
final LogLevel level;
|
||||
|
||||
const LogConfig({this.level = .info});
|
||||
|
||||
LogConfig copyWith({LogLevel? level}) => .new(level: level ?? this.level);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || (other is LogConfig && other.level == level);
|
||||
|
||||
@override
|
||||
int get hashCode => level.hashCode;
|
||||
|
||||
@override
|
||||
String toString() => 'LogConfig(level: $level)';
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
import 'package:immich_mobile/domain/models/config/log_config.dart';
|
||||
import 'package:immich_mobile/domain/models/log.model.dart';
|
||||
|
||||
class SystemConfig {
|
||||
final LogConfig log;
|
||||
final LogLevel logLevel;
|
||||
|
||||
const SystemConfig({this.log = const .new()});
|
||||
const SystemConfig({this.logLevel = .info});
|
||||
|
||||
SystemConfig copyWith({LogConfig? log}) => .new(log: log ?? this.log);
|
||||
SystemConfig copyWith({LogLevel? logLevel}) => SystemConfig(logLevel: logLevel ?? this.logLevel);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || (other is SystemConfig && other.log == log);
|
||||
bool operator ==(Object other) => identical(this, other) || (other is SystemConfig && other.logLevel == logLevel);
|
||||
|
||||
@override
|
||||
int get hashCode => log.hashCode;
|
||||
int get hashCode => logLevel.hashCode;
|
||||
|
||||
@override
|
||||
String toString() => 'SystemConfig(log: $log)';
|
||||
String toString() => 'SystemConfig(logLevel: $logLevel)';
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class LogService {
|
||||
}) async {
|
||||
final instance = LogService._(logRepository, metadataRepository, shouldBuffer);
|
||||
await logRepository.truncate(limit: kLogTruncateLimit);
|
||||
final level = instance._metadataRepository.systemConfig.log.level;
|
||||
final level = instance._metadataRepository.systemConfig.logLevel;
|
||||
Logger.root.level = Level.LEVELS.elementAtOrNull(level.index) ?? Level.INFO;
|
||||
return instance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user