0

Ok this might be one of the not-so-smartest questions I have asked in awhile. Sadly, google led me to no answer (neither did stack).

In a C++ dll file, i have this line:

pSDB->setString("Logger\\AppLogger\\fileLoggerFilename", "rfa.{P}.log")

I, for the life of me, cannot find out what the {P} accurately represents. In the directory, I will get logs that look like: 'rfa.6702.log', 'rfa.6829.log', or 'rfa.7024.log'.

I notice they keep increasing. Does this legitimately mean anything in C++, or just a parameter set in the code?

EDIT:

This code is dealing with Reuters connections. The pSDB is:

"rfa::config::StagingConfigDatabase *ConnectionManager"

Gant
  • 29,661
  • 6
  • 46
  • 65
jpints14
  • 1,361
  • 6
  • 15
  • 24
  • It's probably a form of generating a unique number, though why it wouldn't just go up by one doesn't make much sense with that. – chris Sep 21 '12 at 20:51
  • This was my guess as well. I guess I'm wondering how the number is determined. – jpints14 Sep 21 '12 at 20:53
  • Regarding your edit, you'll need to read the documentation for whatever type `StagingConfigDatabase` is. – ildjarn Sep 21 '12 at 20:54
  • Yea Reuters is notorious for not having that great documentation, especially considering this is a really old API. Don't have access to any form of documentation. – jpints14 Sep 21 '12 at 20:56
  • seeing the log names this can be the PID – remi Sep 21 '12 at 22:38

3 Answers3

7

From here:

The Reuters library replaces the {p} string in the default file name with the UNIX Process ID when it creates the log file.

Jesse Good
  • 50,901
  • 14
  • 124
  • 166
2

This has nothing to do with C++. C++ will never look inside your strings. Same is true for "%d" in printf. It is all a matter of what printf() is doing.

To answer your question, you need to refer to the actual object parsing your string.

Pavel Radzivilovsky
  • 18,794
  • 5
  • 57
  • 67
2

This is not standard C++. It is defined in what looks like may be a logger library. You should look at the documentation for this parcitular library to find out {P} means. In particular, look at the docs for the setString() method in whatever class you used to declare pSDB.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268