mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(mobile): rename log enum to lowercase (#16476)
* chore(mobile): rename log enum to lowercase * chore(mobile): do not abbreviate --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
6cc1978b2d
commit
d8d87bb565
9 changed files with 80 additions and 89 deletions
|
|
@ -39,29 +39,29 @@ class LogService {
|
|||
}
|
||||
|
||||
static Future<LogService> init({
|
||||
required ILogRepository logRepo,
|
||||
required IStoreRepository storeRepo,
|
||||
required ILogRepository logRepository,
|
||||
required IStoreRepository storeRepository,
|
||||
bool shouldBuffer = true,
|
||||
}) async {
|
||||
if (_instance != null) {
|
||||
return _instance!;
|
||||
}
|
||||
_instance = await create(
|
||||
logRepo: logRepo,
|
||||
storeRepo: storeRepo,
|
||||
logRepository: logRepository,
|
||||
storeRepository: storeRepository,
|
||||
shouldBuffer: shouldBuffer,
|
||||
);
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
static Future<LogService> create({
|
||||
required ILogRepository logRepo,
|
||||
required IStoreRepository storeRepo,
|
||||
required ILogRepository logRepository,
|
||||
required IStoreRepository storeRepository,
|
||||
bool shouldBuffer = true,
|
||||
}) async {
|
||||
final instance = LogService._(logRepo, storeRepo, shouldBuffer);
|
||||
final instance = LogService._(logRepository, storeRepository, shouldBuffer);
|
||||
// Truncate logs to 250
|
||||
await logRepo.truncate(limit: kLogTruncateLimit);
|
||||
await logRepository.truncate(limit: kLogTruncateLimit);
|
||||
// Get log level from store
|
||||
final level = await instance._storeRepository.tryGet(StoreKey.logLevel);
|
||||
if (level != null) {
|
||||
|
|
@ -145,7 +145,7 @@ class LoggerUnInitializedException implements Exception {
|
|||
extension LevelDomainToInfraExtension on Level {
|
||||
LogLevel toLogLevel() =>
|
||||
LogLevel.values.elementAtOrNull(Level.LEVELS.indexOf(this)) ??
|
||||
LogLevel.INFO;
|
||||
LogLevel.info;
|
||||
}
|
||||
|
||||
extension on LogLevel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue