Daily logger.
Format: obs_YYYY-MM-DD.log Regex: 'obs_[0-9]{1,4}_[0-9]{1,2}_[0-9]{1,2}.log'
Initialize log config before runApp. And make sure WidgetsFlutterBinding.ensureInitialized() is placed on top of the main function.
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final Directory appDocumentsDir = await getApplicationDocumentsDirectory();
String logPath = join(appDocumentsDir.path, 'logs/');
Ob.applyConfig(
path: logPath, // Log store path
limit: 5 // How many days or how many log files should be kept?
);
runApp(const MyApp());
}Ob.log("Example of log lorem ipsum");List<ObFile> files = await Ob.listFiles();
for(ObFile file in files) {
print(file.toString());
}Enkh-Amar.G (vonqo)