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

Debugger in development mode #31

Closed
escopecz opened this issue Aug 24, 2014 · 5 comments
Closed

Debugger in development mode #31

escopecz opened this issue Aug 24, 2014 · 5 comments
Labels

Comments

@escopecz
Copy link

Hi,

I'd like to get rid of Tracy bar at production. But it is hard-coded at index.php that debugger is in development mode regardless the configuration:

https://github.com/getgrav/grav/blob/master/index.php

Debugger::enable(Debugger::DEVELOPMENT, is_dir(LOG_DIR) ? LOG_DIR : null);

I can see that at develop branch it is hard-coded the opposite way:

https://github.com/getgrav/grav/blob/develop/index.php

'debugger' => new Debugger(Debugger::PRODUCTION)

I'd suggest to use

Debugger::DETECT

This will use development mode on localhost and production mode on public IP. That is what all of us need, isn't it?
More info: https://github.com/nette/tracy#production-mode-and-error-logging

I wanted to implement it and make a pull request, but I can't make develop branch working on my localhost. It seems to have missing few classes. That's why I rather write this issue.

Questions:

  1. Is it possible to implement DETECT mode?
  2. When you plan to release new version? Develop and master branch are quite different...
@rhukster
Copy link
Member

First, the debug option in the 0.8.0 release was a bug. We accidentally set the mode in such a way that it could not be changed by the configuration setting. In the Development branch the debugger is set initially to the PRODUCTION mode and then toggled to whatever you have configured in the new Debugger class:

https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Debugger.php

This means that your system setting will actually work now. In the meantime you can manually edit the index.php and change DEVELOPMENT to PRODUCTION.

Regarding the update, yes development branch has MANY new additions and we hope to release a 0.9.0 version on monday. I just need to work on the documentation updates required and some information explaining how this may effect current users. Content is not effected, it's mostly in plugins and themes (need to change asset handling).

@escopecz
Copy link
Author

Thanks rhukster. Great answer. Looking forward to new version.

I'd add DETECT mode anyway. You see, file based CMS has great advantage that I can use GIT for my content (/user/ folder) and set up post-receive hook to deploy new code to production server. I did that yesterday actually. I'll write an article about it to my new Grav blog. That is main reason why I have chosen Grav in the first place. When I set it up this way, config files will update as well. That's why I need DETECT mode so it will set debug mode automatically.

It requires to add new property to Debugger.php:

const DETECT = TracyDebugger::DETECT;

and turn this mode up if debug option at config file is for example null or empty. Do you think this could appear in future version?

@rhukster
Copy link
Member

I've just pushed a commit to use DETECT by default, but you can override if required in the configuration. Should be out in 0.9.0 shortly.

@escopecz
Copy link
Author

Wow, awesome! Thanks!

@rhukster
Copy link
Member

Should be sorted with 0.9.0 release

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

No branches or pull requests

2 participants