mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-08-14 22:52:35 +02:00
use logging package
This commit is contained in:
parent
99fb8264f1
commit
f24e63d852
14 changed files with 135 additions and 86 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:shelfsdk/audiobookshelf_api.dart';
|
||||
import 'package:whispering_pages/db/cache_manager.dart';
|
||||
|
@ -10,6 +10,8 @@ import 'package:whispering_pages/settings/api_settings_provider.dart';
|
|||
|
||||
part 'api_provider.g.dart';
|
||||
|
||||
final _logger = Logger('api_provider');
|
||||
|
||||
Uri makeBaseUrl(String address) {
|
||||
if (!address.startsWith('http') && !address.startsWith('https')) {
|
||||
address = 'https://$address';
|
||||
|
@ -103,7 +105,7 @@ class PersonalizedView extends _$PersonalizedView {
|
|||
for (final item in resJson)
|
||||
Shelf.fromJson(item as Map<String, dynamic>),
|
||||
];
|
||||
debugPrint('reading from cache: $cachedRes');
|
||||
_logger.fine('reading from cache: $cachedRes');
|
||||
yield res;
|
||||
}
|
||||
|
||||
|
@ -119,7 +121,7 @@ class PersonalizedView extends _$PersonalizedView {
|
|||
fileExtension: 'json',
|
||||
key: key,
|
||||
);
|
||||
debugPrint('writing to cache: $newFile');
|
||||
_logger.fine('writing to cache: $newFile');
|
||||
yield res!;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue