kodus/server-log

console.table support

bkdotcom opened this issue · 5 comments

As referenced in #5 table support is limited / breaks output

https://developer.mozilla.org/en-US/docs/Web/API/Console/table
should accept obj / list of obj, etc

I don't know what this is about.

If you want someone else to look into your issue, you need to post a detailed description of your problem and maybe propose a solution - or submit a PR.

https://github.com/kodus/server-log/

you can use this extension as a drop-in replacement for the original extension.

however.. If I include

ChromePhp::table(array('foo'=>'bar'));

I'll get no output, only a spinner

I referenced the documentation for this feature:

console.table(array)

Logs an array of objects as a table.

Note that we don't use the native DevTools console - this is by design, since we don't want client and server logs mixed into the client-side console.

So this may not have all the "hidden features" of the native DevTools console.

If you'd like to enhance this feature, feel free to submit a PR.

it's a shame it's not possible to use the existing console api, but direct the output to the desired dev-tool tab :(

It's not strictly impossible - the source-code is available, but of course would need some major restructuring to extract the parts you'd need.

I was actually somewhat surprised not to find an npm package with the console functions available as a library - there are lots of third-party tools that implement framework-specific consoles, etc. so this would definitely be useful. (I didn't look very hard, so there still might be?)

(if I was going to attack this problem myself, that would be my approach - extract the console API and make it available as a proper package...)