Skip to content

when a very long log message is printed by LOG(INFO), it will be truncated. #3809

@lcy-seso

Description

@lcy-seso
  • PrintLayer.cpp use LOG(INFO) to print a layer's output matrix and sequence information (if the output is a sequence).

  • Float values in a layer's output matrix are first formatted into an ostringstream. Because a layer's output may contain many float numbers (batch size × layer's size, for example, 128 × 128), as a result, the formatted string is always very long.

  • I found when using LOG(INFO) to print such a long formatted string, the string is truncated. (I change LOG(INFO) into std::cout the string can be printed correctly)

  • It seems that the LOG(INFO) macro has a buffer to cache the logging information, and its size is not large enough in my case.

  • I searched and tried GLOG FLAGS defined in glog, but still, do not success to explicitly change the buffer size of LOG(INFO) to print the entire information.

  • Maybe, we should print such a long string part by part?


I searched the codes and found this line: https://github.com/google/glog/blob/a835da8e088273066c32c3cb0e8ff69d54071217/src/logging.cc#L330

I am not sure is the problem caused by this limitation? If so, it seems that this limitation cannot be modified by pre-defined FLAGS?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions