Skip to content

Commit d14bfa3

Browse files
committed
add documentation
1 parent 101cbde commit d14bfa3

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

flutter_cache_manager/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [3.3.0] - 2021-11-29
2+
* Added option to manage the log level. Doesn't print failed downloads by default anymore. You can set it like this:
3+
```dart
4+
CacheManager.logLevel = CacheManagerLogLevel.verbose;
5+
```
6+
17
## [3.2.0] - 2021-11-27
28
* [Bugfix] getSingleFile now downloads a new file before completing as the outdated file might have been deleted.
39

flutter_cache_manager/example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ void main() {
1212
pubDevURL: 'https://pub.dev/packages/flutter_cache_manager',
1313
pages: [CacheManagerPage.createPage()],
1414
));
15+
CacheManager.logLevel = CacheManagerLogLevel.verbose;
1516
}
1617

1718
const url = 'https://blurha.sh/assets/images/img1.jpg';

flutter_cache_manager/lib/src/logger.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import '../flutter_cache_manager.dart';
22

3+
/// Instance of the cache manager. Can be set to a custom one if preferred.
34
CacheLogger cacheLogger = CacheLogger();
45

6+
/// Log levels of the cache manager. Debug shows failed downloads and verbose
7+
/// also shows successful downloads and cache retrievals.
58
enum CacheManagerLogLevel {
69
none,
710
warning,
811
debug,
912
verbose,
1013
}
1114

15+
/// [CacheLogger] which is used by the cache manager to log useful information
1216
class CacheLogger {
17+
/// Function to log a message on a certain loglevel
1318
void log(String message, CacheManagerLogLevel level) {
1419
if (CacheManager.logLevel.index >= level.index) {
1520
print(message);

flutter_cache_manager/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_cache_manager
22
description: Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.
3-
version: 3.2.0
3+
version: 3.3.0
44
homepage: https://github.com/Baseflow/flutter_cache_manager/tree/master/flutter_cache_manager
55

66
environment:

0 commit comments

Comments
 (0)