mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 05:47:14 +02:00
debugging
This commit is contained in:
@ -125,15 +125,16 @@ 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<<"result:"<<endl;
|
||||||
cout<<"r:"<<result<<endl;
|
cout<<"r:"<<result<<endl;
|
||||||
return result;
|
return result;
|
||||||
@ -146,8 +147,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;
|
lev = level;cout<<"gonna do nowtime"<<endl;
|
||||||
os << "- " << NowTime();
|
os << "- " << NowTime();cout<<"did nowtime"<<endl;
|
||||||
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;
|
||||||
|
Reference in New Issue
Block a user