commit | 5781aa4dce2b9e9f68bf4fd4183a0a61a21b366f | [log] [tgz] |
---|---|---|
author | Christopher Wiley <wiley@chromium.org> | Mon Jul 30 14:42:23 2012 -0700 |
committer | Gerrit <chrome-bot@google.com> | Wed Aug 08 11:39:47 2012 -0700 |
tree | 2e378cc8336b0f8c18c19674271f08a158a92c2c | |
parent | ff845fc996d6742c9ce2d0cd1939745e7034411f [diff] |
shill: Add logic for verbose logging to memory Add a class and macros to log every message from shill to an in memory buffer, and flush to disk on command. This will let us take extremely detailed logs continuously without paying for the disk space to store hours and hours of uninteresting logs. In detail: messages are captured in the same familiar ostream way, except that now we accept all messages regardless of the current verbosity, and dump all the resulting strings into a std::list of std::string. The linked list of all messages is memory capped to a certain number of bytes of message, not including the overhead of the linked list, strings, etc. When we accept a new message, we throw away the oldest messages one at a time until we have enough quota to accept the new message. Messages that pass the existing verbosity checks for ScopedLogger are propagated down to the facillities we get from base/logging (just as before). BUG=chromium-os:31145 TEST=Unit test Change-Id: Ibad57e22c16cfb93889316671bfd1b4e4cb2ef71 Reviewed-on: https://gerrit.chromium.org/gerrit/28743 Commit-Ready: Christopher Wiley <wiley@chromium.org> Reviewed-by: Christopher Wiley <wiley@chromium.org> Tested-by: Christopher Wiley <wiley@chromium.org>