Grab console output on failure

Is it possible to grab the console output if a test szenario fails?

I have created a hook which triggered on failure. How do i now access the browser console? As helper i use puppeteer.

https://codecept.io/helpers/Puppeteer#grabbrowserlogs

Puppeteer has a method called grabBrowserLogs. In your hook you can use it with I.