0

I have a small console application which uses a library (statically linked) that uses glog to cout or cerr for printing the log messages. I want to redirect these messages to file, but using the method specified here doesn't work (Tried it for both cout and cerr).

This is a 3rd party library and I don't have their code, but know for sure that this library uses glog for logging.

How can I still redirect it to a file?

Much thanks!

Community
  • 1
  • 1
rkellerm
  • 5,362
  • 8
  • 58
  • 95

1 Answers1

-1

Well, after adding the log initiating line:

::google::InitGoogleLogging(argv[0]);

and then redirect the streams like suggested here, this worked.

Community
  • 1
  • 1
rkellerm
  • 5,362
  • 8
  • 58
  • 95