Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 694833002: Fix logging API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 86fa1a39af7c55bd5251785e5d0d72cc2109ddc1..748a72e1e887d92caab60887d3222384714bb3f4 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -10365,20 +10365,24 @@ abstract class InternalAnalysisContext implements AnalysisContext {
}
/**
- * The interface `Logger` defines the behavior of objects that can be used to receive
- * information about errors within the analysis engine. Implementations usually write this
- * information to a file, but can also record the information for later use (such as during testing)
- * or even ignore the information.
+ * A `Logger` is an object that can be used to receive information about errors
+ * within the analysis engine. Implementations usually write this information to
+ * a file, but can also record the information for later use (such as during
+ * testing) or even ignore the information.
*/
abstract class Logger {
- static final Logger NULL = new Logger_NullLogger();
+ /**
+ * A logger that ignores all logging.
+ */
+ static final Logger NULL = new NullLogger();
/**
- * Log the given message as an error.
- *
- * @param message an explanation of why the error occurred or what it means
+ * Log the given message as an error. The [message] is expected to be an
+ * explanation of why the error occurred or what it means. The [exception] is
+ * expected to be the reason for the error. At least one argument must be
+ * provided.
*/
- void logError(String message);
+ void logError(String message, [CaughtException exception]);
/**
* Log the given exception as one representing an error.
@@ -10386,15 +10390,15 @@ abstract class Logger {
* @param message an explanation of why the error occurred or what it means
* @param exception the exception being logged
*/
- void logError2(String message, Exception exception);
+ @deprecated
+ void logError2(String message, Object exception);
/**
- * Log the given informational message.
- *
- * @param message an explanation of why the error occurred or what it means
- * @param exception the exception being logged
+ * Log the given informational message. The [message] is expected to be an
+ * explanation of why the error occurred or what it means. The [exception] is
+ * expected to be the reason for the error.
*/
- void logInformation(String message);
+ void logInformation(String message, [CaughtException exception]);
/**
* Log the given exception as one representing an informational message.
@@ -10402,27 +10406,28 @@ abstract class Logger {
* @param message an explanation of why the error occurred or what it means
* @param exception the exception being logged
*/
- void logInformation2(String message, Exception exception);
+ @deprecated
+ void logInformation2(String message, Object exception);
}
/**
- * Implementation of [Logger] that does nothing.
+ * An implementation of [Logger] that does nothing.
*/
-class Logger_NullLogger implements Logger {
+class NullLogger implements Logger {
@override
- void logError(String message) {
+ void logError(String message, [CaughtException exception]) {
}
@override
- void logError2(String message, Exception exception) {
+ void logError2(String message, Object exception) {
}
@override
- void logInformation(String message) {
+ void logInformation(String message, [CaughtException exception]) {
}
@override
- void logInformation2(String message, Exception exception) {
+ void logInformation2(String message, Object exception) {
}
}

Powered by Google App Engine
This is Rietveld 408576698