Skip to content

Commit 8e3fbea

Browse files
committed
Added proper FileOutput stub, addresses simc/logger#94
1 parent ea8c9c4 commit 8e3fbea

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

lib/logger.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ export 'src/ansi_color.dart';
55
export 'src/filters/development_filter.dart';
66
export 'src/filters/production_filter.dart';
77
export 'src/log_filter.dart';
8-
// [LogOutput] class needs to be exposed unconditionally
98
export 'src/log_output.dart';
10-
// ignore: duplicate_export
11-
export 'src/log_output.dart'
12-
if (dart.library.io) 'src/outputs/file_output.dart';
139
export 'src/log_printer.dart';
1410
export 'src/logger.dart';
1511
export 'src/outputs/console_output.dart';
12+
export 'src/outputs/file_output_stub.dart'
13+
if (dart.library.io) 'src/outputs/file_output.dart';
1614
export 'src/outputs/memory_output.dart';
1715
export 'src/outputs/multi_output.dart';
1816
export 'src/outputs/stream_output.dart';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import 'dart:convert';
2+
import 'dart:io';
3+
4+
import '../log_output.dart';
5+
import '../logger.dart';
6+
7+
class FileOutput extends LogOutput {
8+
FileOutput({
9+
required File file,
10+
bool overrideExisting = false,
11+
Encoding encoding = utf8,
12+
}) {
13+
throw UnsupportedError("Not supported on this platform.");
14+
}
15+
16+
@override
17+
void output(OutputEvent event) {
18+
throw UnsupportedError("Not supported on this platform.");
19+
}
20+
}

0 commit comments

Comments
 (0)