shill: Replace VLOG with SLOG.
This CL replaces all uses of VLOG(level) with SLOG(scope, level) with
the same verbose level and an appropriate scope for each affected
logging statement.
BUG=chromium-os:29641
TEST=Build and run unit tests. Test scope logging with ff_debug.
Change-Id: Ifdcf1faa2a309bcbd9ee369a66179ce9c7f1ad19
Reviewed-on: https://gerrit.chromium.org/gerrit/20629
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/HACKING b/HACKING
index 3b3c677..a4abed6 100644
--- a/HACKING
+++ b/HACKING
@@ -1,4 +1,4 @@
-Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
@@ -102,3 +102,20 @@
RATIONALE: The naming convention makes the relationship between the signal
handler and the task function obvious, at-a-glance.
+
+- When adding verbose log messages for debug purposes, use the SLOG marco and
+ its variants (see scope_logger.h for details).
+
+ - Choose the appropriate scope and verbose level for log messages. E.g.
+
+ SLOG(WiFi, 1) << message; // for WiFi related code
+
+ - Before defining a new scope, check if any existing scope defined in
+ scope_logger.h already fulfills the needs.
+
+ - To add a new scope:
+ 1. Add a new value to the Scope enumerated type in scope_logger.h.
+ Keep the values sorted as instructed in the header file.
+ 2. Add the corresponding scope name to the kScopeNames array in
+ scope_logger.cc.
+ 3. Update the GetAllScopeNames test in scope_logger_unittest.cc.