fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.65k stars 121 forks source link

Generate Log FIle #916

Open MaxCWhitehead opened 7 months ago

MaxCWhitehead commented 7 months ago

Description

We should save game logs to disk (and still send to stdout). This will be useful for gathering information if playtesters run into issues.

It also seems like piping stdout when running game from cli doesn't actually work. Possibly due to game being in a subprocess or something related to bevy? Needs investigation.

Alternatives & Prior Art

No response

zicklag commented 7 months ago

Excellent idea. Maybe we should retain like the logs for the last 10 runs of the game or something, just to keep the log from growing infinitely.

Maybe it's logged to stderr instead of stdout and that's why piping wasn't working?

nelson137 commented 6 months ago

Maybe it's logged to stderr instead of stdout and that's why piping wasn't working?

Yep, you can do this to pipe the logs:

./target/debug/jumpy 2>jumpy.log
MaxCWhitehead commented 1 month ago

To confirm last discussion - redirecting both stdout/stderr with &> does seem to work.

Going to work on logging to appropriate directory for platform and rotating log files.