Skip to content

Commit

Permalink
Merge pull request #9 from ptony82/feature/logging-config
Browse files Browse the repository at this point in the history
Logging level is now set by controller in config
  • Loading branch information
kyuhojeong committed Dec 17, 2013
2 parents 2556ff8 + 0acc4ae commit 94e82bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/controlleraccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ void ControllerAccess::HandlePacket(talk_base::AsyncPacketSocket* socket,
if (data[0] != '{') return ProcessIPPacket(socket, data, len, addr);
std::string result;
std::string message(data, 0, len);
LOG_F(INFO) << message;
Json::Reader reader;
Json::Value root;
if (!reader.parse(message, root)) {
Expand Down Expand Up @@ -212,9 +211,19 @@ void ControllerAccess::HandlePacket(talk_base::AsyncPacketSocket* socket,
}
break;
case SET_LOGGING: {
int flag = root["flag"].asInt();
if (flag > 0) talk_base::LogMessage::LogToDebug(talk_base::LS_INFO);
else talk_base::LogMessage::LogToDebug(talk_base::LS_ERROR + 1);
int logging = root["logging"].asInt();
if (logging == 0) {
talk_base::LogMessage::LogToDebug(talk_base::LS_ERROR + 1);
}
else if (logging == 1) {
talk_base::LogMessage::LogToDebug(talk_base::LS_ERROR);
}
else if (logging == 2) {
talk_base::LogMessage::LogToDebug(talk_base::LS_INFO);
}
else if (logging == 3) {
talk_base::LogMessage::LogToDebug(talk_base::LS_SENSITIVE);
}
}
break;
default: {
Expand Down
1 change: 0 additions & 1 deletion src/tincan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ bool SSLVerificationCallback(void* cert) {

int main(int argc, char **argv) {
talk_base::InitializeSSL(SSLVerificationCallback);
talk_base::LogMessage::LogToDebug(talk_base::LS_INFO);
peerlist_init();
int translate = 1;

Expand Down

0 comments on commit 94e82bb

Please sign in to comment.