mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
debugging
This commit is contained in:
parent
93f99f9aa8
commit
385941d75e
@ -125,18 +125,15 @@ inline std::string NowTime()
|
|||||||
|
|
||||||
inline std::string NowTime()
|
inline std::string NowTime()
|
||||||
{
|
{
|
||||||
cout<<"111"<<endl;
|
char buffer[11];
|
||||||
char buffer[11];
|
time_t t;
|
||||||
time_t t;cout<<"222"<<endl;
|
time(&t);
|
||||||
time(&t);cout<<"333"<<endl;
|
tm r = {0};
|
||||||
tm r = {0};cout<<"444"<<endl;
|
strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r));
|
||||||
strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r));cout<<"555"<<endl;
|
struct timeval tv;
|
||||||
struct timeval tv;cout<<"666"<<endl;
|
gettimeofday(&tv, 0);
|
||||||
gettimeofday(&tv, 0);cout<<"777"<<endl;
|
char result[100] = {0};
|
||||||
char result[100] = {0};cout<<"888"<<endl;
|
|
||||||
sprintf(result, "%s.%03ld", buffer, (long)tv.tv_usec / 1000);
|
sprintf(result, "%s.%03ld", buffer, (long)tv.tv_usec / 1000);
|
||||||
cout<<"result:"<<endl;
|
|
||||||
cout<<"r:"<<result<<endl;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,8 +144,8 @@ template <typename T> Log<T>::Log():lev(logDEBUG){}
|
|||||||
|
|
||||||
template <typename T> std::ostringstream& Log<T>::Get(TLogLevel level)
|
template <typename T> std::ostringstream& Log<T>::Get(TLogLevel level)
|
||||||
{
|
{
|
||||||
lev = level;cout<<"gonna do nowtime"<<endl;
|
lev = level;
|
||||||
os << "- " << NowTime();cout<<"did nowtime"<<endl;
|
os << "- " << NowTime();
|
||||||
os << " " << ToString(level) << ": ";
|
os << " " << ToString(level) << ": ";
|
||||||
os << std::string(level > logDEBUG ? level - logDEBUG : 0, '\t');
|
os << std::string(level > logDEBUG ? level - logDEBUG : 0, '\t');
|
||||||
return os;
|
return os;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user