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

Unified Diff: utils/pub/log.dart

Issue 13095015: Use backtracking when solving dependency constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up some test code. Created 7 years, 9 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: utils/pub/log.dart
diff --git a/utils/pub/log.dart b/utils/pub/log.dart
index ec3fee9798944e586b359b1a0ab0891f78f8d0e0..eb414492545b7a1cbb3e71cec9b7d676d657b1c9 100644
--- a/utils/pub/log.dart
+++ b/utils/pub/log.dart
@@ -36,6 +36,9 @@ class Level {
/// operation, process spawning, or file IO.
static const IO = const Level._("IO ");
+ /// Incremental output during pub's version constraint solver.
+ static const SOLVER = const Level._("SLVR");
+
/// Fine-grained and verbose additional information. Can be used to provide
/// program state context for other logs (such as what pub was doing when an
/// IO operation occurred) or just more detail for an operation.
@@ -56,6 +59,9 @@ class Entry {
Entry(this.level, this.lines);
}
+/// Returns `true` if [level] is being recorded in some way.
+bool isEnabled(Level level) => _loggers != null && _loggers[level] != null;
+
/// Logs [message] at [Level.ERROR].
void error(message) => write(Level.ERROR, message);
@@ -68,6 +74,9 @@ void message(message) => write(Level.MESSAGE, message);
/// Logs [message] at [Level.IO].
void io(message) => write(Level.IO, message);
+/// Logs [message] at [Level.SOLVER].
+void solver(message) => write(Level.SOLVER, message);
+
/// Logs [message] at [Level.FINE].
void fine(message) => write(Level.FINE, message);
@@ -168,6 +177,7 @@ void showNormal() {
_loggers[Level.WARNING] = _logToStderr;
_loggers[Level.MESSAGE] = _logToStdout;
_loggers[Level.IO] = null;
+ _loggers[Level.SOLVER] = null;
_loggers[Level.FINE] = null;
}
@@ -178,6 +188,18 @@ void showIO() {
_loggers[Level.WARNING] = _logToStderrWithLabel;
_loggers[Level.MESSAGE] = _logToStdoutWithLabel;
_loggers[Level.IO] = _logToStderrWithLabel;
+ _loggers[Level.SOLVER] = null;
+ _loggers[Level.FINE] = null;
+}
+
+/// Sets the verbosity to "solver", which shows errors, warnings, messages, and
+/// solver logs.
+void showSolver() {
+ _loggers[Level.ERROR] = _logToStderr;
+ _loggers[Level.WARNING] = _logToStderr;
+ _loggers[Level.MESSAGE] = _logToStdout;
+ _loggers[Level.IO] = null;
+ _loggers[Level.SOLVER] = _logToStdout;
_loggers[Level.FINE] = null;
}
@@ -187,6 +209,7 @@ void showAll() {
_loggers[Level.WARNING] = _logToStderrWithLabel;
_loggers[Level.MESSAGE] = _logToStdoutWithLabel;
_loggers[Level.IO] = _logToStderrWithLabel;
+ _loggers[Level.SOLVER] = _logToStderrWithLabel;
_loggers[Level.FINE] = _logToStderrWithLabel;
}
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/package.dart » ('j') | utils/pub/package.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698