wallabyjs / console-ninja

Repository for Console Ninja questions and issues
https://console-ninja.com
Other
378 stars 18 forks source link

[Bug]: The new feature "Capture Functions" only console log ellipsis if there are only function properties in the object #84

Closed omerson-cruz closed 1 year ago

omerson-cruz commented 1 year ago

What happened?

I was expecting the feature "Capture Functions" to show all function but instead it show ellipsis if there are only function properties in the object being logged

Version

V.0.0.63

Steps to reproduce (or sample repo)

I retested the features request from Feature #83 but not working when there are only FUnctions inside of the object (for example the "rest" parameter as seen below)

So here is my CustomSwitch component and the "register" function is returning some functions.

Scenario 1: [object has only function properties] - Ninja is only loggin ellipsis and there are no properties shown

image

Now the functions being returned by the "register" I want to log inside of the CustomSwitch component as part of the "rest" parameter object. but instead I only see "ellipsis"

image

Scenario 2: [object has function properties and a single data] - Ninja works and is now showing the data property and function properties.

image

image

(But what if there's really no data included in the object, I hope I still can log the names of the functions in the object.)

I know it's will waste some real estate and may not be useful in most of scenario but I think it will help in some debugging cases especially if using some third party libraries or someone else's functions.

Especially in React where data and functions are being passed around like when using Context APIs.

Thank you!

Log output

info host ------------ starting ------------
info extension 
info host client connected: extension { address: '::', family: 'IPv6', port: 46305 }
info host worker Starting Host Worker...
info host starting host: {"extensionFolder":"/home/omersonc/.vscode-server/extensions/wallabyjs.console-ninja-0.0.63","runtimeHookFile":"/home/omersonc/.vscode-server/extensions/wallabyjs.console-ninja-0.0.63/out/runtimeHook/tracer.js","globalErrorHandlerFile":"/home/omersonc/.vscode-server/extensions/wallabyjs.console-ninja-0.0.63/out/runtimeHook/errorHandler.js","filesToInstrument":["/home/omersonc/ws/entourage-github/components/entourage/lib/ForgotPasswordForm/index.js","/home/omersonc/ws/entourage-github/components/entourage/lib/UserTenantLoginLink/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/common/Changepassword.js","/home/omersonc/ws/entourage-github/.yarn/releases/yarn-1.18.0.cjs","/home/omersonc/ws/entourage-github/components/entourage/lib/common/DxScheduler/DxCoreScheduler.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/common/Forgotpassword.js","/home/omersonc/ws/entourage-github/components/entourage/lib/common/DxTreeList/DxCoreTreeList.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/common/Verify.js","/home/omersonc/ws/entourage-github/components/entourage/lib/tenant-ui/AcceptInviteForm/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Event/Dashboard/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Event/BasicInfo/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Event/Details/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/HomePage/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Signup/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Events/Tickets/TicketSettingsPage.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Users/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/tenant-ui/Events/Tickets/TicketSettingsPage-v2.js","/home/omersonc/ws/entourage-github/components/entourage/lib/LoginForm/index.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/platform/Users/UsersListPage.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/platform/Tenants/AddTenants.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/platform/Users/AddUsers.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/platform/Users/helper/UserRolesCell.js","/home/omersonc/ws/entourage-github/pages/entourage/lib/platform/Tenants/TenantsListPage.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/tickets/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/user/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/policy/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/tenant/users.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/tenant/events.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/platform-api/user/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/platform-api/tenant/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/logger/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/auth/index.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/tenant-api/router/index.js","/home/omersonc/ws/entourage-github/packages/data/lib/common/providers/auth/AuthGuard.js","/home/omersonc/ws/entourage-github/packages/data/lib/tenant/TicketSettingsProvider/index.js","/home/omersonc/ws/entourage-github/applications/attendee-ui/next.config.js","/home/omersonc/ws/entourage-github/applications/tenant-ui/next.config.js","/home/omersonc/ws/entourage-github/applications/tenant-ui/pages/tenant/events/index.js","/home/omersonc/ws/entourage-github/applications/tenant-ui/pages/switch-tenant.bkp.js","/home/omersonc/ws/entourage-github/applications/platform-ui/next.config.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/webpack/pages/site-builder.eb8fcfc18dc2d456.hot-update.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/webpack/pages/site-builder.dbf04b31559cfcc9.hot-update.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/server/pages/site-builder.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/chunks/amp.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/chunks/pages/_app.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/chunks/pages/site-builder.js","/home/omersonc/ws/entourage-github/applications/grapesjs-poc/.next/static/chunks/main.js","/home/omersonc/ws/entourage-github/packages/utilities/lib/api/index.js"],"debug":false,"config":{"dateTimeFormat":"hh:mm:ss","openLinksInEditor":true,"maxLogViewerEntries":100,"autoClearLogViewerOnFileChanges":true,"outputMode":"In View","captureFunctions":true,"toolsToAutoPatch":["vite","jest","webpack","next.js","cypress","http-server","serve","nuxt","remix","hydrogen","live-server","live-preview"]},"allowedHosts":["localhost","127.0.0.1","example.cypress.io","LEGION","app.dev.entourage-events.link","regime.dev.entourage-events.link","platform.dev.entourage-events.link","platform.dev.entourage-events.link:3000","platform.entourage-events.link:3000","172.24.42.24"],"host":"localhost"}
info host starting tools discovery and integration
info host found yarn package manager usages in /home/omersonc/ws/entourage-github
info host updating yarn plugin in /home/omersonc/.yarnrc.yml
info host looking for tools to patch
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info host found 18 tool file(s) to patch
info host patching /home/omersonc/.vscode-server/extensions/ritwickdey.liveserver-5.7.9/node_modules/live-server/index.js
info host patching /home/omersonc/ws/entourage-github/node_modules/webpack/lib/webpack.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@storybook/core-client/node_modules/webpack/lib/index.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@storybook/core-client/node_modules/webpack/lib/webpack.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@storybook/react/node_modules/webpack/lib/index.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@storybook/react/node_modules/webpack/lib/webpack.js
info host patching /home/omersonc/ws/entourage-github/node_modules/jest/bin/jest.js
info host patching /home/omersonc/ws/entourage-github/node_modules/jest-runner/build/testWorker.js
info host patching /home/omersonc/ws/entourage-github/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /home/omersonc/ws/entourage-github/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /home/omersonc/ws/entourage-github/components/entourage/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /home/omersonc/ws/entourage-github/pages/entourage/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /home/omersonc/ws/entourage-github/components/entourage/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /home/omersonc/ws/entourage-github/pages/entourage/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@entourage-web/react-components/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@entourage-web/react-pages/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@entourage-web/react-components/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /home/omersonc/ws/entourage-github/node_modules/@entourage-web/react-pages/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host completed tools discovery and integration
info buildHook-1806 allowed tools: vite, jest, webpack, next.js, cypress, http-server, serve, nuxt, remix, hydrogen, live-server, live-preview
info buildHook-1806 running tools: next.js
info host client connected: buildHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 allowed tools: vite, jest, webpack, next.js, cypress, http-server, serve, nuxt, remix, hydrogen, live-server, live-preview
info buildHook-1806 running tools: next.js
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 4 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 0 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 11 log points, error handler: false
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 0 log points, error handler: false
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 0 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 8 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 0 log points, error handler: false
info buildHook-1806 file processed (stat): 1 log points, error handler: false
info buildHook-1806 file processed (stat): 0 log points, error handler: false
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 3 log points, error handler: false
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 2 log points, error handler: false
info host client disconnected: runtimeHook 1001
info host client disconnected: runtimeHook
info host client connected: runtimeHook { address: '::', family: 'IPv6', port: 46305 }
info buildHook-1806 file processed (stat): 2 log points, error handler: false
ArtemGovorov commented 1 year ago

Thanks for the detailed report. The issue is fixed and the fix is published in v0.0.64+.

omerson-cruz commented 1 year ago

Cool that was really quick action. I confirmed that it is now working. Thanks again for this wonderful tool :)