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

Proposal: Use boost::logs to capture log data #95

Closed
BenjamenMeyer opened this issue May 7, 2020 · 12 comments · Fixed by #172
Closed

Proposal: Use boost::logs to capture log data #95

BenjamenMeyer opened this issue May 7, 2020 · 12 comments · Fixed by #172
Assignees
Labels
Milestone

Comments

@BenjamenMeyer
Copy link
Member

BenjamenMeyer commented May 7, 2020

Instead of always dumping data to the console, let's capture it to a file properly. Boost provides boost::logs which can fulfill this in a platform independent way.

UPDATE: As a general rule everything should go to our log file. The exceptions:

  • getting the log going
  • fatal errors where we crash out, in which case if we can it should go to the log but should also go to the console/std::error.

We should also force a limit on log file size and do file rotations; these probably should be part of the configuration.

@BenjamenMeyer BenjamenMeyer added this to the Backlog milestone May 7, 2020
@nabaco
Copy link
Member

nabaco commented May 7, 2020

That's sound like some of the changes that @stephengtuggy has done in the past

@BenjamenMeyer
Copy link
Member Author

@nabaco yes, there's probably something related to that. The current gitter discussion with trying to capture data to a log file got me thinking of this, so just wanted to capture it for the moment. If we already have something that can be re-enabled that'd be great and then we can pull this into one of the current milestones as a bug fix.

@stephengtuggy
Copy link
Contributor

Yeah, basically I think my BOOST_LOG_TRIVIAL stuff just needs to be re-enabled. That is how Vega Strike does its debug output now (as opposed to stdout or stderr output, which are separate in the current version of VS).

Perhaps a Phase 2 of this issue would be redirecting everything to BOOST_LOG_TRIVIAL. No more stdout/cout/stderr/cerr.

@nabaco
Copy link
Member

nabaco commented May 7, 2020

Sounds good. @stephengtuggy are you willing to undertake this endeavor?

@BenjamenMeyer
Copy link
Member Author

@stephengtuggy yes, I'd like to see everything go to file the boost logs and have only minimal output on stdout/cout/stderr/cerr - namely output before the logs can get configured and after they're shutdown, perhaps with info on where the logs are being stored too so people can easily find them.

@stephengtuggy
Copy link
Contributor

@nabaco I'll think about it.

@stephengtuggy
Copy link
Contributor

stephengtuggy commented May 7, 2020

Possibly related to #5

@BenjamenMeyer
Copy link
Member Author

@stephengtuggy #5 will have some impact certainly - though we'll have to ensure that log messages are readable enough by both users and us to be useful for actually debugging stuff too.

@royfalk
Copy link
Contributor

royfalk commented May 10, 2020

I was actually looking into BOOST_LOG_TRIVIAL as well and did some work on it before discovering everyone else is also thinking/working on it. @stephengtuggy since you started already, it's yours if you want it. Just be sure to assign the issue to yourself so we'll know.

@stephengtuggy
Copy link
Contributor

Yeah, basically I think my BOOST_LOG_TRIVIAL stuff just needs to be re-enabled. That is how Vega Strike does its debug output now (as opposed to stdout or stderr output, which are separate in the current version of VS).

Perhaps a Phase 2 of this issue would be redirecting everything to BOOST_LOG_TRIVIAL. No more stdout/cout/stderr/cerr.

I'm going to leave this issue (#95) for the Phase 2 part of it. For Phase 1, re-enabling the BOOST_LOG_TRIVIAL stuff I had already put in place, I have filed #107 .

@ermo
Copy link
Contributor

ermo commented May 11, 2020

(repost from another issue)

Guys, fatal errors really ought to be printed (or at least also copied) to stderr?

Not doing so tends to break the principle of least astonishment.

Bonus points for posting a short text blurb after VS has exited with an error code, where the blurb points to the latest log file like @BenjamenMeyer also suggested.

@BenjamenMeyer
Copy link
Member Author

@ermo yes, as a general rule everything should go to the log file. The exceptions should be:

  • getting the log going
  • fatal errors where we crash out, in which case if we can it should go to the log but should also go to the console/std::error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants