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

create logfiles also on linux #4805

Open
gfgtdf opened this issue Mar 14, 2020 · 5 comments
Open

create logfiles also on linux #4805

gfgtdf opened this issue Mar 14, 2020 · 5 comments
Labels

Comments

@gfgtdf
Copy link
Contributor

@gfgtdf gfgtdf commented Mar 14, 2020

On windows wesnoth creates logfiles that contain the output of stderr, on linux that does afaik not happen. I don't know whether its my lack of linux knowledge but when i recently started wesnoth normally (here this means: form the desktop launcher with no console attached) and got an error then i had no idea how to get the output that was written to stderr, a situation that can no happen on windows due to the logfiles.

Even if linux somehow does supports recovering the stderr output of a non-termianl programm that did already run, i really don't expect users from who i might want bug reports to be able to figure out how to do it if i am unable to do it myself.

So what i propose it: generate logfiles on linux just as we do on windows.

@gfgtdf gfgtdf added the Enhancement label Mar 14, 2020
@shikadiqueen

This comment has been minimized.

Copy link
Member

@shikadiqueen shikadiqueen commented Mar 14, 2020

Whoever tackles this can reuse the code in log_windows.cpp but it's mandatory for them to:

  1. Handle macOS and other Unices as well.
  2. Copy rather than redirect Wesnoth's to a file, without eliminating terminal output, so that tools that expect to see its stderr through a pipe don't break horribly bad.

In the meantime, you can just make your launcher use a command like this:

sh -c "wesnoth 2> ~/test.log"

And to keep the terminal output when launching from a terminal:

sh -c "wesnoth 2>&1 | tee ~/test.log"

(If launching directly from a terminal then you can skip the sh -c and the double quotes around.)

@shikadiqueen

This comment has been minimized.

Copy link
Member

@shikadiqueen shikadiqueen commented Mar 14, 2020

It's also worth noting that the above isn't really new knowledge. See How to locate the game logs (linked from the Technical Support instructions).

@loonycyborg

This comment has been minimized.

Copy link
Member

@loonycyborg loonycyborg commented Mar 14, 2020

I think creating logfiles by default on unix-likes will be unexpected behaviour, so it probably should be only enabled by a command line option or preferences file

@loonycyborg

This comment has been minimized.

Copy link
Member

@loonycyborg loonycyborg commented Mar 14, 2020

Though it might be ok to enable by default if both stderr and logfile output are kept

@shikadiqueen

This comment has been minimized.

Copy link
Member

@shikadiqueen shikadiqueen commented Mar 14, 2020

Though it might be ok to enable by default if both stderr and logfile output are kept

This should be the only option like I said above.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.