easyloggingpp icon indicating copy to clipboard operation
easyloggingpp copied to clipboard

Logging a char* with NULL value hides all subsequent logs

Open jeremija opened this issue 9 years ago • 2 comments

For example:

char* text1 = strdup("test string");
char* text2 = NULL;
LOG(INFO) << "Test";
LOG(INFO) << NULL;
LOG(INFO) << text1;
LOG(INFO) << text2;
LOG(INFO) << "Test";

results in:

2015-05-27 10:11:25,592 INFO  [default] Test
2015-05-27 10:11:25,592 INFO  [default] 0
2015-05-27 10:11:25,592 INFO  [default] test string
2015-05-27 10:11:25,592 INFO  [default] 
2015-05-27 10:11:25,592 INFO  [default] 

Running Ubuntu 14.04.2 LTS and compiling with gcc 4.8.2 and -std=c++11 flag.

jeremija avatar May 27 '15 08:05 jeremija

me too

geyijun avatar Oct 17 '15 08:10 geyijun

Same for me, here the test for it: https://github.com/amrayn/easyloggingpp/compare/master...ctin:nullptr_test

ctin avatar Jan 28 '21 18:01 ctin