easyloggingpp
easyloggingpp copied to clipboard
对char类型支持有缺陷,请确认
char type=2;
LOG(INFO)<<"type="<<type; //output is false! type=
LOG(INFO)<<"type="<<(u_char)type; //output is true! type=2
It use std::stringstream or std::wstringsteam to format, ref to this. you can test use this:
std::stringstream ss;
ss << static_cast<int>(type) << " vs " << type;
std::cout << ss.str();
LOG(INFO)<<"type="<<type; //output is false! type=
this is not output empty, because the ascii char 2 is control char.
It use std::stringstream or std::wstringsteam to format, ref to this. you can test use this:
std::stringstream ss; ss << static_cast<int>(type) << " vs " << type; std::cout << ss.str();
LOG(INFO)<<"type="<<type; //output is false! type=
this is not output empty, because the ascii char 2 is control char.
According to you say,So “unsigned char” is error!
unsigned char type=65;
cout<<"type="<<type<<endl;//type=A
LOG(INFO)<<"type="<<type; //output is false! type=65
It use std::stringstream or std::wstringsteam to format, ref to this. you can test use this:
std::stringstream ss; ss << static_cast<int>(type) << " vs " << type; std::cout << ss.str();
LOG(INFO)<<"type="<<type; //output is false! type=
this is not output empty, because the ascii char 2 is control char.
According to you say,So “unsigned char” is error!
unsigned char type=65; cout<<"type="<<type<<endl;//type=A LOG(INFO)<<"type="<<type; //output is false! type=65
have you define macro ELPP_UNICODE
? if you define it, std::wstringstream is used.
unsigned char type = 65;
std::wstringstream ss;
ss << type;
std::wcout << "type=" << ss.str() << std::endl; //type=65