#Need to capture console

16 messages ยท Page 1 of 1 (latest)

short shoal
#

How to capture console like info/log/warn etc

eternal thorn
#

you could create a proxy of the console object and forward the calls to the different methods

short shoal
#

is it possible to get it from the browser console too?

trim forum
#

theyre both just going through the console object

#

won't work for the console repl though, that's a separate thing

#

i mean the binding for output will work, but not the input for the repl

short shoal
#

I want to get everything that is displayed into the browser console. such as any unexpected error, type error network error etc.

i'm creating here a helper npm package to do that
@trim forum @eternal thorn

GitHub

Contribute to ashra-tech/ashra-log development by creating an account on GitHub.

short shoal
#

any update???

eternal thorn
#

what do you mean "any updates" @short shoal?

#

if you want to tap into the call of console.log, console.error and alike, just use a proxy, as explained before

#

๐Ÿ‘‰ the browser console "input" is part of the runtime (browser),
not part of the console object
the console object doesn't have any input methods

#

๐Ÿ‘‰ same thing for error messages, it's just a way the runtimes displays an error happening,
it's not an actual call to console.error
you cannot capture it

#

๐Ÿ‘‰ messages from other processes (browser extensions, different contexts) probably can't be captured either, since it's a different console object in a different process
jsut that the browser displays all the outputs of all those objects in the same place
you can't capture those as well

short shoal
#

log, info, warn i can get that perfectly but i have to capture everything such as any network issue that is shows on console. and unexpected error, reference error etc. the goal is to capture everything