xpl / ololog

A better console.log for the log-driven debugging junkies
https://www.npmjs.com/package/ololog
The Unlicense
215 stars 8 forks source link

Chrome Console output does not output location correctly #30

Open nicewaytodoit opened 3 years ago

nicewaytodoit commented 3 years ago

While running ololog in React I have noticed that it does not output location file from the point where it is called but shows always as event raised by ololog.js:145.

with location config = false it will show:

3/22/2021, 11:22:14 AM  "My Log>> XXX"       ololog.js:145

with location config = false it will show:

3/22/2021, 11:22:14 AM  "My Log>> XXX"       ololog.js:145
(<computed> → <computed> → <computed> @ pipez.js:47)

while log was raised in the file example.js.

Even in your demo it will output something like: https://xpl.github.io/ololog/

foo ra (<computed> → <computed> → <computed> → <computed> @ pipez.js:48)  ololog.js:145 
xpl commented 3 years ago

Thanks for the report, I'll check that.

xpl commented 3 years ago

There was indeed a trouble when linking Ololog as a script tag from another website — stack entries going to that script were not handled correctly. I fixed that.

But that might not fix your issue if you're importing the library using import directive. I'll investigate on that later. What specific framework/bundler do you use?

nicewaytodoit commented 3 years ago

Latest version ololog, latest Webpack fresh test project. Simple create-react-app will give the setup.

Haleclipse commented 3 years ago

It seems that it does not work in "HMR";

image