mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 15:49:49 +00:00
21 lines
419 B
Dart
21 lines
419 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:logger/logger.dart';
|
|
import 'package:logger/src/outputs/file_output.dart';
|
|
|
|
import 'util.dart';
|
|
|
|
final logger = Logger(
|
|
printer: PrettyPrinter(),
|
|
output: buildOutput(),
|
|
);
|
|
|
|
buildOutput() {
|
|
// if is debug mode, output to console
|
|
if (!kDebugMode && Util.isDesktop()) {
|
|
return FileOutput(file: File('log.txt'));
|
|
}
|
|
return null;
|
|
}
|