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

Default module setting for easy usage of the logging functions #8

Merged
merged 3 commits into from
Sep 23, 2020

Conversation

SirMoM
Copy link
Contributor

@SirMoM SirMoM commented Sep 9, 2020

This allows to set a default module and using it without specifying it every time.

Example:

var out_strats = [Logger.STRATEGY_PRINT, Logger.STRATEGY_PRINT, Logger.STRATEGY_PRINT, Logger.STRATEGY_PRINT, Logger.STRATEGY_PRINT]

Logger.add_module("App", Logger.VERBOSE, out_strats)
Logger.default_module = "App"

Logger.debug("No file selected!")
Logger.info("Could not open file " + path)

This logs:

[DEBUG] [App] No file selected!
[INFO] [App] Could not open file 404

@SirMoM SirMoM force-pushed the feature/default-module-setting branch from 45ad17e to 7e3359c Compare September 9, 2020 19:45
@SirMoM
Copy link
Contributor Author

SirMoM commented Sep 9, 2020

So I fixed some sloppiness on my part. This should be alright now.

logger.gd Outdated Show resolved Hide resolved
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
@akien-mga akien-mga merged commit 0fc607e into KOBUGE-Games:master Sep 23, 2020
@akien-mga
Copy link
Member

Thanks!

@SirMoM SirMoM deleted the feature/default-module-setting branch November 5, 2020 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants