#@Emiliano Bucci What about `logger: {

1 messages · Page 1 of 1 (latest)

elder dust
#

@prime oar I'll try, thanks for the tip!

elder dust
#

@prime oar It works, but it seems that only in development and not in production

prime oar
#

Uh. Yeah it is possible that this can not be activated in production.

#

If you need request logging you probably could use a custom fetch that logs the request before sending it.

#
export default function customFetch(url, options) {
  console.log("Fetch", url, options);
  return fetch(url, options);
}
elder dust
#

@prime oar Yes, but if the function is called multiple times I will get multiple logs, while maybe there's only one request for that function. So, multiple function invocations and just 1 request, because is deduped by next.

prime oar
#

Maybe if you'd wrap the function inside the cache function exported by react?

#

As long as the function parameters are the same the function will not run again, but a cached result will be returned

#

You could always patch your next package and enable the logging option in production

#

make the changes to the package itself and run yarn patch next