Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Filter logs by level#24263

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromro0NL:logs-levels
Oct 10, 2018
Merged

Filter logs by level#24263

fabpot merged 1 commit intosymfony:masterfromro0NL:logs-levels
Oct 10, 2018

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedSep 19, 2017
edited
Loading

QA
Branch?3.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Proposal to filter logs by level. This PR competes with#23247 (but also see#23038) which propose to filter by channel.

Before

image

After

image

From#23247 (comment)

Adding configuration is always adding complexity for the end user. If we can do otherwise (including doing nothing), i think that might be better. I all depends on the current "brokenness" status.

This avoids that. Also single click; noise gone.

kaznovac, theofidry, joshlopes, yceruto, sroze, kbond, lyrixx, noniagriconomie, and andreybolonin reacted with thumbs up emojiOskarStark, theofidry, joshlopes, yceruto, lyrixx, andreybolonin, and noniagriconomie reacted with heart emoji
@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 19, 2017
edited
Loading

Logs panel (profiler) has a significantly slower page load, basically renders before tabs are applied.

My experience is this is not really related to debug/deprecation/container logs, but (duplicate) var dumping.

This

image

times 60+.

edit: on the upside.. they are all searchable 😓

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneSep 20, 2017
@noniagriconomie
Copy link
Contributor

👍🏻 This is good :)
Nice to see your implementation

@javiereguiluz
Copy link
Member

@ro0NL I appreciate your efforts here a lot. I like the idea and I want to have this in Symfony ... but I don't like the implementation. Also, I think it's too late to make this right on time for Symfony 3.4 feature freeze.

In my opinion, the interface should be like this: the table headers (Channel and Level) should be intelligent and include the following elements.

  1. The channel table header should work like this GitHub element:

channel-filter

That's how I can easily filter log messages by any channel ... and it doesn't matter how many channels there are.

  1. The level table header should display a range slider to select the minimum level of the log messages you want to see. I wouldn't let the user freely select anything ("I want to see critical and debug messages" <-- it doesn't make sense to me). I prefer to let the user select "debug or higher", "critical or higher", etc.

Something like this, but not so ugly:

level-slider

jvasseur reacted with thumbs up emojiro0NL, yceruto, OskarStark, ogizanagi, and theofidry reacted with heart emoji

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 21, 2017
edited
Loading

Well.. if we can filter by leveland channel; that be awesome. I can imagine it's useful with lots of (user-defined) channels within the debug level.

I like the slider approach; intuitively raising the log level. However this does not solve my real usecase; disable debug to expose what's critical.

edit:

"critical or higher", etc.

(Lets say "warning or higher", or only critical ;)) that's exactly what's needed yes. Your slider UI probably implies both points can be set, thats cool 🎉

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 21, 2017
edited
Loading

Also see#24244 which improves the overall experience on heavy requests/logs panel, addresses#24263 (comment)

var rows=document.querySelectorAll('table.logs tr[data-log-level="'+ name+'"]');
for (var i=0, row; row= rows[i];++i) {
row.style.display=row.style.display=='none'?'table-row':'none';
}
Copy link
Member

@keraduskeradusSep 22, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

btw, you just faced vars hoisting ;P

anyway, please replace with:

document.querySelectorAll('table.logs tr[data-log-level="'+name+'"]').forEach(function(row){row.style.display=row.style.display==='none' ?'table-row' :'none';});

ro0NL and kaznovac reacted with thumbs up emoji
}
</script>
<div>
{%forlevelin ['DEBUG','INFO','NOTICE','WARNING','ERROR','CRITICAL','ALERT','EMERGENCY'] %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this shall not be hardcoded levels here.
i do know it's not likely to happen, but if one come up with other log level like "CONFIDENT" or "PERFORMANCE", he will need to be aware that he has to update template as well. not easy thing

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

"he" will be SF core :) not our problem. Tend to be pragmatic here :) (for a poc at least). The PSR levels are not likely to change.

Yes. Your point is valid; open for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

it's long term issue. PSR could be change after 2 years, and nobody will remember after 2 years that some template has to be change due to that

<div>
{%forlevelin ['DEBUG','INFO','NOTICE','WARNING','ERROR','CRITICAL','ALERT','EMERGENCY'] %}
<inputtype="checkbox"id="log-level-{{level }}"checked="checked"onclick="toggleLevel('{{level }}');" />
<labelfor="log-level-{{level }}">{{level }}</label>&nbsp;&nbsp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👎 for hardcoding&nbsp;&nbsp; in template

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

But it looks good :) For now copied from somewhere else. Again, valid point :)

<labelfor="log-level-{{level }}">{{level }}</label>&nbsp;&nbsp;
{%endfor %}
</div>
{%endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

oh, damn, it's copy-pasted...

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

See#24281 for a first step to sanity. But we cant really do something here; as twigbundle and profiler live separated. Causing other issues btw :)

perhaps leverage var-dumper for shared code. Might also help#24151

Im not happy with this :) but also SF problem mostly.

@keradus
Copy link
Member

nice idea@ro0NL 👍 !
just few comments from my side

@ro0NL
Copy link
ContributorAuthor

@keradus comments addressed. For now all open :) as@javiereguiluz mentioned; this might be too simple. Yet as first step to proper log filtering i hope to see something in 3.4 yes.

@noniagriconomie
Copy link
Contributor

@ro0NL ( cc@javiereguiluz )

As I said in my issue#23038 early june, I think it could be a really cool tool (even in a simple implementation) for 3.4 launch

Many thanks !

@weaverryan
Copy link
Member

I like this. But... it's not mission critical and we don't want to release something that's not as polished as it could be. I tend to agree with@javiereguiluz when it comes to visual things. Though... is it possible to merge this before feature freeze and tweak the visuals after?@ro0NL would you be able to tweak the visuals like Javier talked about? Or would@javiereguiluz need to do that (and does he have the bandwidth... I'm terrible at design stuff)

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 27, 2017
edited
Loading

@weaverryan if we leave out channel filtering first, i might give this a try this weekend. So focus on the level filter, which is what this PR is about really :) (but filtering channels is valid, for sure).

Hope to get@ogizanagi pov as welll, since he wrote the var-dumper search UI. Perhaps he has a plan...

First thought was;<input type="range" multiple> and be done. That doesnt exist today though, but we do have HTML5 drag&drop api.

I'm terrible at design stuff

Yep. This needs to be prepared, but first we need a plan :)

@ogizanagi
Copy link
Contributor

ogizanagi commentedSep 27, 2017
edited
Loading

I love@javiereguiluz examples:

  • The channel UI suggestion based on the Github labels filters UI would be perfect as is.
  • For the log level selection, indeed amultiple range widget with ticks and labels would be great, but has to be done manually as there is no native way to achieve it AFAIK.

No plan right now, I can give it a try...but that'll wait for 4.1 I think 😅


📝 might be useful:https://codepen.io/trevanhetzel/pen/rOVrGK

@weaverryan
Copy link
Member

I think it would be fine to do log level now, then channel filtering later. It may still be a challenge to get something quickly (and dependably) that looks nice. But, I'd love if you could make that happen@ro0NL :)

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 27, 2017
edited
Loading

Range inputs can bestyled native actually. Shocking.

Maybe combine to range inputs for lower/upper bound. I believe@javiereguiluz proposal implies that.. going to jsfiddle NOW :)

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 27, 2017
edited
Loading

Got somethinghttps://jsfiddle.net/z2ov274f/

Let me know if this works for you. I think it just might do 👍

@javiereguiluz
Copy link
Member

@ro0NL I think you are over-delivering here 😄 I don't think we need a multi-range slider. A user wants to see"debug logs or higher","info logs or higher","warning logs or higher", etc. A step-by-step slider like this one would be enough:

slider

jvasseur reacted with thumbs up emojiDavidBadura reacted with confused emoji

@noniagriconomie
Copy link
Contributor

Yes indeed, simple is better :)

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 28, 2017
edited
Loading

The problem is we always include debug then; thus the noise.

@javiereguiluz
Copy link
Member

javiereguiluz commentedSep 28, 2017
edited
Loading

@ro0NL make "info" the initial value of the slider. Problem solved!

@noniagriconomie
Copy link
Contributor

@ro0NL DYT my idea offilter logs by channel can be acheived in this same PR?

I am really sure it is a good feature for a developer

The use case is simple, when we reach this section of profiler's log, we come here for a very specific reason, so the more specific the data is visualy, the best it is :)

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 28, 2017
edited
Loading

@javiereguiluz you're right. Increasing the slider, means indeed "info/warning/etc. or higher". I had this mindset where it increases from the first level (debug till warning, debug till error, etc.).

The right boundary is fixed, not the left one :)

Anyway made the multiple range thingy a gist, can probably use it sometime :-) Ill try to finish this one this weekend.@noniagriconomie ill check channels as well, to see if something simple is possible.

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 28, 2017
edited
Loading

Latest version after some discussion with@javiereguiluz

https://jsfiddle.net/m2xq73ba/

Almost there.

edit: i also just realized for this UX to be right we need to go from critical to debug, so left-to-right.

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedSep 29, 2017
edited
Loading

It's kinda working :) Screenshot updated.

  • buttons only, range slider removed (it did not bring much value). yet it still works as a slider!
  • css colors picked with care
  • debug disabled by default in twigbundle
  • i suggest to remove tabs profiler in favor of log level filters (container tab excluded) so that both tables (twig+profiler) are the same.
  • what about level DEBUG for missing translations only in debug mode?

https://jsfiddle.net/po23sLge/ 😂

@ogizanagi
Copy link
Contributor

ogizanagi commentedSep 29, 2017
edited
Loading

Indeed, I'd be in favor of removing theDebug tab to be merged in the first one (but deprecations should be kept appart. Not sure about silenced notices), and keep debug disabled by default, like it is on exception pages. It also have another advantage: it's didactic and hints you can change the levels to show:

screenshot 2017-09-29 a 23 31 43

I see both active and inactive pills. I understand I can disable some levels.

screenshot 2017-09-29 a 23 35 02

I can't see any difference, wrongly assume these are tabs.

Perhaps that's where the slider was more obvious. But clearly, I'd not put both.

@sstok
Copy link
Contributor

What about pills with a checkbox? (like a filter).

DavidBadura reacted with thumbs up emoji

@noniagriconomie
Copy link
Contributor

IMO multi select input would be better (and take less space in the view)
and after it could be easier to duplicate with channels's multi select input

@ro0NL
Copy link
ContributorAuthor

ro0NL commentedOct 2, 2017
edited
Loading

About the checkbox/filter issues... im not sure =/ i tend to agree with@javiereguiluz

I wouldn't let the user freely select anything ("I want to see critical and debug messages" <-- it doesn't make sense to me).

It's about increasing/decreasing severity, not necessarily "filter by field".

and after it could be easier to duplicate with channels's multi select input

Im not aiming for channel filters anymore with this PR, so should not be a blocker, nor do they have to be the same widget style in the future.

@nicolas-grekas
Copy link
Member

Moving to 4.1. Rebase on master might be needed, where PHP 7.1 features can be used btw.

@nicolas-grekasnicolas-grekas modified the milestones:3.4,4.1Oct 8, 2017
@maff
Copy link
Contributor

maff commentedOct 9, 2017

Just for the record:#23247 is about filtering logs completely so they aren't even written to the profiler (for performance reasons) while this PR is about filtering logs when viewing them in the profiler.

👍 for this feature, would be a nice addition!

@ro0NL
Copy link
ContributorAuthor

I'm willing to finish this, and quite happy with my work so far actually :)

But there are many ways we can solve this UX-wise, and perhaps we should aim for a simpler approach.

Im curious if e.g.@javiereguiluz@ogizanagi ... has some time to help me move forward, or willing to takeover from here on.

@fabpot
Copy link
Member

Can we resume the work here. It seems that we are almost there. Having this in 4.2 would be great.@javiereguiluz ?

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Last call for reviews before merge :)

@fabpot
Copy link
Member

For merge on master of course

@fabpot
Copy link
Member

UI tweaks can happen during the stabilization phase.

@fabpotfabpot changed the base branch from3.4 tomasterOctober 10, 2018 12:43
@fabpot
Copy link
Member

Thank you@ro0NL.

@fabpotfabpot merged commit8f88753 intosymfony:masterOct 10, 2018
fabpot added a commit that referenced this pull requestOct 10, 2018
This PR was submitted for the 3.4 branch but it was merged into the 4.2-dev branch instead (closes#24263).Discussion----------Filter logs by level| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->Proposal to filter logs by level. This PR competes with#23247 (but also see#23038) which propose to filter by channel.<details><summary>Before</summary>![image](https://user-images.githubusercontent.com/1047696/30607022-00536bbe-9d74-11e7-84dd-6427d328f50b.png)</details><details><summary>After</summary>![image](https://user-images.githubusercontent.com/1047696/31036405-6346da12-a56c-11e7-8747-b1ae89c549f2.png)</details>From#23247 (comment)> Adding configuration is always adding complexity for the end user. If we can do otherwise (including doing nothing), i think that might be better. I all depends on the current "brokenness" status.This avoids that. Also single click; noise gone.Commits-------8f88753 Filter logs by level
@ro0NLro0NL deleted the logs-levels branchOctober 15, 2018 11:30
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+1 more reviewer

@keraduskeraduskeradus left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

11 participants

@ro0NL@noniagriconomie@javiereguiluz@keradus@weaverryan@ogizanagi@sstok@nicolas-grekas@maff@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp