lots of formatting/naming fixes and changed Context::name to std::string
diff --git a/aos/common/logging/logging_impl.cc b/aos/common/logging/logging_impl.cc
index 7b49f7b..64696dc 100644
--- a/aos/common/logging/logging_impl.cc
+++ b/aos/common/logging/logging_impl.cc
@@ -101,7 +101,7 @@
message->level = level;
message->source = context->source;
- memcpy(message->name, context->name, context->name_size);
+ memcpy(message->name, context->name.c_str(), context->name.size() + 1);
time::Time now = time::Time::Now();
message->seconds = now.sec();
diff --git a/aos/common/logging/logging_impl.h b/aos/common/logging/logging_impl.h
index 28ffd99..1416fe1 100644
--- a/aos/common/logging/logging_impl.h
+++ b/aos/common/logging/logging_impl.h
@@ -161,11 +161,9 @@
// Will be NULL if there is no logging implementation to use right now.
LogImplementation *implementation;
- // A string representing this task/(process and thread).
- const char *name;
- // The number of bytes in name (including the terminating '\0').
- // Must be <= sizeof(LogMessage::name).
- size_t name_size;
+ // A name representing this task/(process and thread).
+ // strlen(name.c_str()) must be <= sizeof(LogMessage::name).
+ ::std::string name;
// What to assign LogMessage::source to in this task/thread.
pid_t source;
diff --git a/aos/common/logging/logging_impl_test.cc b/aos/common/logging/logging_impl_test.cc
index bc411ce..f64f3d6 100644
--- a/aos/common/logging/logging_impl_test.cc
+++ b/aos/common/logging/logging_impl_test.cc
@@ -57,9 +57,10 @@
static_cast<uint32_t>(log_implementation->message().source),
static_cast<uint32_t>(context->source));
}
- if (strcmp(log_implementation->message().name, context->name) != 0) {
+ if (strcmp(log_implementation->message().name,
+ context->name.c_str()) != 0) {
Die("got a message from %s, but we're %s\n",
- log_implementation->message().name, context->name);
+ log_implementation->message().name, context->name.c_str());
}
if (strstr(log_implementation->message().message, message.c_str())
== NULL) {