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

Logger should exit if an ERROR-level log is received #11

Open
adamhutchings opened this issue May 29, 2021 · 6 comments
Open

Logger should exit if an ERROR-level log is received #11

adamhutchings opened this issue May 29, 2021 · 6 comments
Assignees

Comments

@adamhutchings
Copy link
Contributor

No description provided.

@Sophon96
Copy link
Contributor

What do you mean by "Logger should exit?" Shouldn't the caller function be responsible for terminating the program, if necessary?

@adamhutchings
Copy link
Contributor Author

If we receive an error-level log, it means the game can't continue on, so it should exit. Calling System.exit everywhere would be a needless reduplication of code.

@Sophon96
Copy link
Contributor

We should probably make an exit() or cleanup() function for cleaning up before exiting (e.g. saving the game state).

@adamhutchings
Copy link
Contributor Author

We have one, it's called FlowerKnight.exit

@JakeRoggenbuck
Copy link
Member

So if the severity of a log is Error, the logger should call FlowerKnight.exit?

@adamhutchings
Copy link
Contributor Author

Exactly. @jackie777seven , look at Jake's latest comment for what to do. (However, keep in mind that FlowerKnight.exit only cleans up the application - it does not terminate the application, which you also need to do. System.exit does that.)

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

No branches or pull requests

4 participants