Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Log directory stats to file (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 authored Oct 12, 2023
2 parents 655c06b + 1a6d76e commit 3326a7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions lib/ui/tools/debug/app_storage_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import "package:logging/logging.dart";
import 'package:path_provider/path_provider.dart';
import 'package:photos/core/cache/video_cache_manager.dart';
import 'package:photos/core/configuration.dart';
Expand Down Expand Up @@ -29,6 +30,7 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
late String iosTempDirectoryPath;
late bool internalUser;
int _refreshCounterKey = 0;
final Logger _logger = Logger("_AppStorageViewerState");

@override
void initState() {
Expand Down Expand Up @@ -104,12 +106,16 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
}

Future<void> prettyStringDirectoryStats(List<String> paths) async {
for (var path in paths) {
final DirectoryStat state = await getDirectoryStat(Directory(path));
final content = prettyPrintDirectoryStat(state, path);
if (content.isNotEmpty) {
debugPrint(content);
try {
for (var path in paths) {
final DirectoryStat stat = await getDirectoryStat(Directory(path));
final content = prettyPrintDirectoryStat(stat, path);
if (content.isNotEmpty) {
_logger.info(content);
}
}
} catch (e) {
_logger.severe("Failed to print directory stats", e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: ente photos application
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 0.7.100+500
version: 0.7.101+501

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit 3326a7a

Please sign in to comment.