Bug 181025 - console.log doesn't print anything on JS console of clean machine
Summary: console.log doesn't print anything on JS console of clean machine
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-20 02:36 PST by Ebrahim Byagowi
Modified: 2018-01-04 12:42 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ebrahim Byagowi 2017-12-20 02:36:14 PST
Repro:
1. Provide a clean or maybe also on recently update macOS.
2. Open JS console using this particular way, right click on the page, click on "Inspect Element", go to "Console" tab.
3. console.log("Hello");

Actual:
Nothing will be printed

Expected:
To console.log work regardless.


It seems for making JS console.log I should enter JS console, particularly using Develop > "Show JavaScript Console", but if I bring it first using "Inspect Element" the bit activates JS console won't be altered.
Comment 1 Joseph Pecoraro 2017-12-20 14:54:50 PST
This seems like a regression. We should look into this!
Comment 2 Radar WebKit Bug Importer 2017-12-20 14:55:26 PST
<rdar://problem/36165180>
Comment 3 Joseph Pecoraro 2017-12-20 14:55:37 PST
Does this reproduce for you with the Safari Technology Preview?
Comment 4 Ebrahim Byagowi 2017-12-20 15:50:46 PST
> Does this reproduce for you with the Safari Technology Preview?

I can't say for sure as I am not sure whether I've opened console of it on some other way or not. I remember that was happening before update of 10.13 also, can you have a look how logging of JS console will be enabled on Safari? And whether that has anything to do enabling logging or does it change level of visible logs?
Comment 5 Ebrahim Byagowi 2017-12-20 16:04:28 PST
> And whether that has anything to do [...]

Whether it has anything to do with "Show JavaScript Console" button or not
Comment 6 Joseph Pecoraro 2018-01-02 15:07:35 PST
I was unable to reproduce this issue. The Console tab shows, the "All" filter is selected, and the log message shows up.

Do you remember what this looked like? If you apply a filter (clicking "Errors" in the Console tab near the top) is that what it looked like? I'm wondering if a filter was applied and you weren't aware. That would indicate we should try to make filters / filtering behavior clearer when applying, but first I'd want to verify if it might have been filters.
Comment 7 Ebrahim Byagowi 2018-01-03 01:55:42 PST
> I was unable to reproduce this issue.

So you used an unused macOS for that and that happened? So perhaps something is wrong on my side.

> The Console tab shows, the "All" filter is selected, and the log message shows up. Do you remember what this looked like?

I am not sure but can you do some code inspection whether "Show Web Inspector" button has anything to do with console logging level?

> If you apply a filter (clicking "Errors" in the Console tab near the top) is that what it looked like? I'm wondering if a filter was applied and you weren't aware.

I just got familiar with the feature recently and to be honest something never learnt and used throughout many years of consistent use of inspector on Chrome and Safari. but yeah I believe it needs some revamp, perhaps by looking at Chrome and Firefox inspectors.
Comment 8 Ebrahim Byagowi 2018-01-03 02:27:35 PST
> I was unable to reproduce this issue.

So you used an unused macOS for that and that happened? So perhaps something is wrong on my side.

> The Console tab shows, the "All" filter is selected, and the log message shows up. Do you remember what this looked like?

I am not sure but can you do some code inspection whether "Show Web Inspector" button has anything to do with console logging level?

> If you apply a filter (clicking "Errors" in the Console tab near the top) is that what it looked like? I'm wondering if a filter was applied and you weren't aware.

I just got familiar with the feature recently and to be honest something never learnt and used throughout many years of consistent use of inspector on Chrome and Safari. but yeah I believe it needs some revamp, perhaps by looking at Chrome and Firefox inspectors.
Comment 9 Brian Burg 2018-01-04 10:44:32 PST
(In reply to Ebrahim Byagowi from comment #8)
> > I was unable to reproduce this issue.
> 
> So you used an unused macOS for that and that happened? So perhaps something
> is wrong on my side.
> 
> > The Console tab shows, the "All" filter is selected, and the log message shows up. Do you remember what this looked like?
> 
> I am not sure but can you do some code inspection whether "Show Web
> Inspector" button has anything to do with console logging level?

It doesn't. Console messages are buffered regardless of whether a frontend is attached. You need to enable developer tools, though, to buffer messages prior to opening the debugger.

> 
> > If you apply a filter (clicking "Errors" in the Console tab near the top) is that what it looked like? I'm wondering if a filter was applied and you weren't aware.
> 
> I just got familiar with the feature recently and to be honest something
> never learnt and used throughout many years of consistent use of inspector
> on Chrome and Safari. but yeah I believe it needs some revamp, perhaps by
> looking at Chrome and Firefox inspectors.
Comment 10 Ebrahim Byagowi 2018-01-04 12:42:49 PST
Thanks, I will try to aggregate more things times.

I just guess however "You need to enable developer tools, though, to buffer messages prior to opening the debugger" is going to get forget somehow on system updates and just doing "Show Web Inspector" (and not opening it with inspect) is going to enable it. I wish I could see the code behind it as I am almost sure this happened for me twice on macOS updates.