blob: 5a8e3550ece835700b7935be98b548cf460086a5 [file] [log] [blame]
// Copyright 2016 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'dart:io';
abstract class Logger {
void info(String message);
void error(String message);
void trace(String message);
}
class StdoutLogger extends Logger {
@override
void info(String message) {
stderr.writeln('[INFO] $message');
}
@override
void error(String message) {
stderr.writeln('[ERROR] $message');
}
@override
void trace(String message) {}
}
class VerboseLogger extends Logger {
@override
void info(String message) {
stderr.writeln('[INFO] $message');
}
@override
void error(String message) {
stderr.writeln('[ERROR] $message');
}
@override
void trace(String message) {
stderr.writeln('[TRACE] $message');
}
}
class DumbLogger extends Logger {
@override
void info(String message) {}
@override
void error(String message) {
stderr.writeln('[ERROR] $message');
}
@override
void trace(String message) {}
}