packaging: add AMB configuration that enables the plugin
[profile/ivi/ico-vic-amb-plugin.git] / tests / logresult.cc
1 #include <sstream>
2
3 #include "logresult.h"
4
5 LogResult::LogResult() {
6 }
7
8 LogResult::~LogResult() {
9 }
10
11 std::string LogResult::MakeString(enum ClientType cltype, enum CommandType cotype, std::string property) {
12     CurrentTime();
13     std::stringstream sstr;
14     sstr << tv.tv_sec << "." << std::setfill('0') << std::setw(6) << std::right << tv.tv_usec << " ";
15     switch (cltype) {
16     case CLIENT_VIC :
17         sstr << "VIC ";
18         break;
19     case CLIENT_APP :
20         sstr << "APP ";
21         break;
22     default :
23         sstr << "Unknown ";
24         break;
25     }
26     switch (cotype) {
27     case CMDTYPE_SET:
28         sstr << "SET ";
29         break;
30     case CMDTYPE_GET:
31         sstr << "GET ";
32         break;
33     case CMDTYPE_NOTIFY:
34         sstr << "NOTIFY ";
35         break;
36     case CMDTYPE_CALLBACK:
37         sstr << "CALLBACK ";
38         break;
39     default :
40         sstr << "NONE ";
41         break;
42     }
43
44     sstr << property << " ";
45     return sstr.str();
46 }
47
48 void LogResult::CurrentTime() {
49     gettimeofday(&tv, NULL);
50 }