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

Unified Diff: packages/logging/lib/logging.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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
« no previous file with comments | « packages/logging/codereview.settings ('k') | packages/logging/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/logging/lib/logging.dart
diff --git a/logging/lib/logging.dart b/packages/logging/lib/logging.dart
similarity index 95%
rename from logging/lib/logging.dart
rename to packages/logging/lib/logging.dart
index f1641dca98352fdb6af78ac9073c915103dfe6a9..493d8599584b1ffeba5f872e8691644fa840df1a 100644
--- a/logging/lib/logging.dart
+++ b/packages/logging/lib/logging.dart
@@ -61,6 +61,18 @@ class Logger {
return _loggers.putIfAbsent(name, () => new Logger._named(name));
}
+ /// Creates a new detached [Logger].
+ ///
+ /// Returns a new [Logger] instance (unlike `new Logger`, which returns a
+ /// [Logger] singleton), which doesn't have any parent or children,
+ /// and it's not a part of the global hierarchial loggers structure.
+ ///
+ /// It can be useful when you just need a local short-living logger,
+ /// which you'd like to be garbage-collected later.
+ factory Logger.detached(String name) {
+ return new Logger._internal(name, null, new Map<String, Logger>());
+ }
+
factory Logger._named(String name) {
if (name.startsWith('.')) {
throw new ArgumentError("name shouldn't start with a '.'");
« no previous file with comments | « packages/logging/codereview.settings ('k') | packages/logging/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698