Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File log messages have duplicate timestamps #576

Open
shameekganguly opened this issue Feb 15, 2024 · 1 comment
Open

File log messages have duplicate timestamps #576

shameekganguly opened this issue Feb 15, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shameekganguly
Copy link
Contributor

E.g. 2024-02-08T22:15:18.176363233) (2024-02-08T22:15:18.176405072) [GUI] [Dbg] [Gui.cc:340] GUI requesting list of world names. The server may be busy downloading resources. Please be patient.

Seems to be coming from appending datetime once here and again here.

@shameekganguly shameekganguly added the bug Something isn't working label Feb 15, 2024
@azeey
Copy link
Contributor

azeey commented Feb 15, 2024

It's not clear to me what the original intention was. If it's to add a timestamp for both the console output and the file log, then we can just replace

  Console::log() << "(" << common::systemTimeIso() << ") ";
  std::stringstream prefixString;

with

  std::stringstream prefixString;
  prefixString << "(" << common::systemTimeIso() << ") ";

because all of contents of prefixString will end up in both the console and the file log.

If our intention is to have the timestamp just in the file log, but not in the console, then we would need to remove the () in Console::Log(), so it will be:

  Console::log << "(" << common::systemTimeIso() << ") ";
  std::stringstream prefixString;
  ...

@azeey azeey added the help wanted Extra attention is needed label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: To do
Development

No branches or pull requests

2 participants