diff options
author | Keir Mierle <keir@google.com> | 2020-02-02 13:58:19 -0800 |
---|---|---|
committer | CQ Bot Account <commit-bot@chromium.org> | 2020-02-03 23:21:15 +0000 |
commit | 8c352dc5dd026d470deda1671e091ff5cc147741 (patch) | |
tree | f81bcfd8135f682eb441a294690cfb2c7984ebad /pw_log_basic | |
parent | de27674bc67c895e0b8c26bcfca63e31423d73e9 (diff) | |
download | pigweed-8c352dc5dd026d470deda1671e091ff5cc147741.tar.gz |
pw_kvs: Implement KVS load from flash
This starts the implementation of loading the KVS from flash. Much
remains to do before this is done. This patch also includes some
extensions to how the tests are handled, to make it easier to
instantiate multiple KVS and flash backends for testing.
Changes is this CL to potentially split out:
- KVS dump command to log contents
- Re-enabling function and file display in log (useful!)
- Hex dumping to log
Change-Id: Ib1b25a01aa29eec3d3acd09e40205c23ded7bf6a
Diffstat (limited to 'pw_log_basic')
-rw-r--r-- | pw_log_basic/log_basic.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pw_log_basic/log_basic.cc b/pw_log_basic/log_basic.cc index a8f8c8d2d..c586830a8 100644 --- a/pw_log_basic/log_basic.cc +++ b/pw_log_basic/log_basic.cc @@ -40,6 +40,7 @@ // TODO(pwbug/17): Expose these through the config system. #define PW_USE_EMOJIS 1 #define PW_LOG_SHOW_FILENAME 0 +#define PW_LOG_SHOW_FUNCTION 0 #define PW_LOG_SHOW_FLAG 0 #define PW_LOG_SHOW_MODULE 0 @@ -98,17 +99,22 @@ extern "C" void pw_Log(int level, const char* function_name, const char* message, ...) { - PW_UNUSED(function_name); - PW_UNUSED(line_number); - // Accumulate the log message in this buffer, then output it. pw::StringBuffer<150> buffer; // Column: Filename #if PW_LOG_SHOW_FILENAME - buffer.Format(" %-30s |", GetFileBasename(file_name)); + buffer.Format(" %-30s:%4d |", GetFileBasename(file_name), line_number); #else PW_UNUSED(file_name); + PW_UNUSED(line_number); +#endif + + // Column: Function +#if PW_LOG_SHOW_FUNCTION + buffer.Format(" %20s |", function_name); +#else + PW_UNUSED(function_name); #endif // Column: Module |