blob: bae5c9632bd15db7303a8c652d3cddc28e4c4bf2 [file] [log] [blame]
part of webdriver;
class Logs extends _WebDriverBase {
Logs._(driver) : super(driver, 'log');
Future<Iterable<LogEntry>> get(String logType) async =>
(await _post('', {'type': logType})).map(
(entry) => new LogEntry.fromMap(entry));
}
class LogEntry {
final String message;
final int timestamp;
final String level;
const LogEntry(this.message, this.timestamp, this.level);
LogEntry.fromMap(Map map)
: this(map['message'], map['timestamp'], map['level']);
}
class LogType {
static const String BROWSER = 'browser';
static const String CLIENT = 'client';
static const String DRIVER = 'driver';
static const String PERFORMANCE = 'performance';
static const String PROFILER = 'profiler';
static const String SERVER = 'server';
}
class LogLevel {
static const String OFF = 'OFF';
static const String SEVERE = 'SEVERE';
static const String WARNING = 'WARNING';
static const String INFO = 'INFO';
static const String DEBUG = 'DEBUG';
static const String ALL = 'ALL';
}