Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Docker refresh #1001
Docker refresh #1001
Changes from all commits
5f2eac3
8719555
3330548
6efb14d
b6a2a84
62c3a86
572290a
58fb25c
4bbf969
562cc53
8c39c10
9fa3313
613df9d
ae86e2f
c3eb97e
fcff989
d4ae036
19dab2d
8546f17
10aa2ea
a04a5e6
0e6b6b4
7c5afd7
0b95a55
074a7c2
36a18de
c750373
53f855d
4f4ae38
599132b
2869597
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm_Debug::add?
You should also check DEBUG_MODE constant - it is true in index.php but config_gen copies that to site/index.php (which is used as the main entry point of the web app) and turns it into false. Keep it to true in docker env if you want deubgging mode turned on or make it come from dotenv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see where DEBUG_MODE is read in the environment. I only see it hard coded at the beginning of scripts. So I cant pass it in. I'm confused what DEBUG_MODE is for exactly, but I dont think it does what I'm going for. It looks like a way of enabling features and it does some log queuing.
I was looking for a way to log at different severity levels. I'm not sure of the php way to do that.
I am just trying to print a message to the console at the time it happens. So I think print, or error_log seem ok for here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, DEBUG_MODE is only hard-coded in scripts for now. It will be a good idea to extend that to come from the environment.
It is best to still use the debug class to queue these messages. Hm_Msgs is another one meant to be displayed to the user. Console scripts can dump the debug and/or msgs arrays at the end to the cli using print statements. error_log will send the message to the php error log which seldom appears on the screen for users (depends on several PHP settings to appear).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am genuinely confused with the logging setup and it has bitten me several times. There is a lot of good info being sent go Hm_Debug::add, but its hard to get the data out from there. I lost several hours trying to fix a sqlite bug that would have been minutes if those logs were simply displayed.
Its possible PHP logging is different because one of the output streams is meant to screen/browser output. I hear Laraval is a commonly used PHP framework, so I looked up their logging setup: https://laravel.com/docs/11.x/logging
which seems quite standard. It uses monolog which provides simple, immediate, customizable outputs.
Let me know if I am off base, or I can create a separate ticket for this and elaborate more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm_Debug uses Hm_list which has
get
method to get the messages andshow
method to send them to the error log. PHP error logging might be complex and not everything logged, indeed, it has settings for error_reporting - what kind of errors to report, then displaying errors on screen or writing errors to a log file - thus third option also depends on your backend server setup. So, a lot of moving parts.Integrating something like monolog is an option but note that cypht started with minimalism in mind while Laravel is enormous, so we still try to depend on fewer external libs. That being said, I think an ENV setting for DEBUG_MODE which is observed and makes sure debugging messages are written to the php error log at the end of a request + screen/cli if necessary seems like a better approach to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving this discussion to a separate issue #1027