mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
Logging support for server
R=devoncarew@google.com, scheglov@google.com Review URL: https://codereview.chromium.org//136333008 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31926 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
79d3555394
commit
5388d0ce8b
|
@ -1,4 +1,4 @@
|
|||
Copyright 2013, the Dart project authors. All rights reserved.
|
||||
Copyright 2014, the Dart project authors. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
|
44
pkg/analysis_server/lib/src/analysis_logger.dart
Normal file
44
pkg/analysis_server/lib/src/analysis_logger.dart
Normal file
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library analysis.logger;
|
||||
|
||||
import 'package:analyzer/src/generated/engine.dart';
|
||||
import 'package:logging/logging.dart' as logging;
|
||||
|
||||
/**
|
||||
* Instances of the class [AnalysisLogger] translate from the analysis engine's
|
||||
* API to the logging package's API.
|
||||
*/
|
||||
class AnalysisLogger implements Logger {
|
||||
/**
|
||||
* The underlying logger that is being wrapped.
|
||||
*/
|
||||
final logging.Logger baseLogger = new logging.Logger('analysis.server');
|
||||
|
||||
@override
|
||||
void logError(String message) {
|
||||
baseLogger.severe(message);
|
||||
}
|
||||
|
||||
@override
|
||||
void logError2(String message, Exception exception) {
|
||||
baseLogger.severe(message, exception);
|
||||
}
|
||||
|
||||
@override
|
||||
void logError3(Exception exception) {
|
||||
baseLogger.severe("Exception", exception);
|
||||
}
|
||||
|
||||
@override
|
||||
void logInformation(String message) {
|
||||
baseLogger.info(message);
|
||||
}
|
||||
|
||||
@override
|
||||
void logInformation2(String message, Exception exception) {
|
||||
baseLogger.info(message, exception);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue