shill: Improves debug output of Config80211 code.
This CL does a few things to improve the Config80211 debugging output.
It replaces the |GenericToString| method with |Print| for messages and
attributes so that a) newlines print correctly and b) nested attributes
print better; it removes anachronistic |Nl80211Message::ToString|
method; and it standardizes message send and receive output.
The |Nl80211Message::ToString| method was originally used to compare
config80211 output with that of the 'iw' program. Unit tests and the
new |Print| method have been introduced to supplant the need for
|ToString|. This CL removes |ToString| and a number of helper methods
that support it.
BUG=None.
TEST=unittest and manual test (invoked shill with a specific log level
and verified that the printouts were correct).
Change-Id: I7f9133a2bd63864d20ed56b588f2139126360ccd
Reviewed-on: https://gerrit.chromium.org/gerrit/44057
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
diff --git a/attribute_list.h b/attribute_list.h
index 274a0cd..7a3d19b 100644
--- a/attribute_list.h
+++ b/attribute_list.h
@@ -35,7 +35,10 @@
// their attributes as message templates.
bool CreateAndInitFromNlAttr(nl80211_attrs id, const nlattr *data);
- std::string ToString() const;
+ // Prints the attribute list with each attribute using no less than 1 line.
+ // |indent| indicates the amout of leading spaces to be printed (useful for
+ // nested attributes).
+ void Print(int log_level, int indent) const;
// Returns the attributes as the payload portion of a netlink message
// suitable for Sockets::Send. Return value is empty on failure (or if no