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

Make the native logger "show if shell visible" setting default. #173

Closed
TheContainer opened this issue Apr 26, 2024 · 5 comments · Fixed by #175
Closed

Make the native logger "show if shell visible" setting default. #173

TheContainer opened this issue Apr 26, 2024 · 5 comments · Fixed by #175
Labels
Feature✨ New feature or request

Comments

@TheContainer
Copy link

TheContainer commented Apr 26, 2024

Is your feature request related to a problem? Please describe.
I really want to leave the console in the exported build. But the problem is, the logger is always visible by default. I could just change the settings, but these are stored in the user folder, which means that they don't transfer across devices.

Describe the solution you'd like
Make the native logger "show if shell visible" setting default.

@Ark2000 Ark2000 added the Feature✨ New feature or request label Apr 28, 2024
@Ark2000
Copy link
Owner

Ark2000 commented Apr 28, 2024

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

@TheContainer
Copy link
Author

TheContainer commented Apr 28, 2024

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

That is an even better idea and would work perfectly.

@worron
Copy link
Collaborator

worron commented Apr 28, 2024

I've got a better plan, now a default config file will be added to the plugin's folder, what do you think of it?

I'm afraid it might have a negative impact on git submodule routine, which I consider as very valuable feature of panku plugin. User settings should not affect git status of your project, and it works perfectly right now.

Obvious workaround is to make panku config file path customizable in godot project settings. Not sure if is it easy to implement though.

@Ark2000
Copy link
Owner

Ark2000 commented Apr 29, 2024

now a rough solution is:

whenever load_module_data is called, such as load_module_data("show_timestamp", true)

  1. find config file in user:// path, if not found, go to step 2
  2. find config file in developer specified res:// path (in project settings), if not found, go to step 3
  3. no config file found or the kv pair does't exist in config file, use the default value provided in function call.

[quit]

save everything to user:// path config file using save_module_data in quit_module.

@worron
Copy link
Collaborator

worron commented Apr 29, 2024

Decent solution overall, but a couple minor inconvenience can be spotted.

[quit]

save everything to user:// path config file using save_module_data in quit_module.

How will user do config changes when file located in res:// then? Manually editing file or coping it from user://?

  1. find config file in user:// path, if not found, go to step 2

That means when you are switching from user:// to res:// you need not only edit project settings but also remove file from user directory. Second action feels a bit non intuitive and unnecessary.


I would consider slightly tweaked workflow like:

Whenever load_module_data is called, such as load_module_data("show_timestamp", true):

  1. Define config file path with some function find_config_path. It will read developer specified path from project settings, if there is no such option or it's empty then use default user://. Go to 2.
  2. Try to read defined file, if not found or other problem, go to step 3.
  3. No config file found or the kv pair does't exist in config file, use the default value provided in function call.

[quit]

Save everything to file defined in step 1 (we can repeat call find_config_path here, or just save result somewhere on first call) using save_module_data in quit_module.

Ark2000 added a commit that referenced this issue May 5, 2024
Ark2000 added a commit that referenced this issue May 6, 2024
* feat: custom default config file

refers to: #173

* Update addons/panku_console/common/config.gd

Co-authored-by: worron <worrongm@gmail.com>

---------

Co-authored-by: worron <worrongm@gmail.com>
Ark2000 added a commit to Ark2000/panku_console that referenced this issue May 6, 2024
* feat: custom default config file

refers to: Ark2000/PankuConsole#173

* Update addons/panku_console/common/config.gd

Co-authored-by: worron <worrongm@gmail.com>

---------

Co-authored-by: worron <worrongm@gmail.com> (Ark2000/PankuConsole@6e8ad31))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants