mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 22:41:02 +00:00
chore: suppress console output in production
- Silence console.log/debug/info in production mode - Keep filtered console.warn for important warnings - Keep console.error for critical issues
This commit is contained in:
+8
-1
@@ -1,6 +1,13 @@
|
|||||||
// Suppress noisy Polkadot.js API warnings in production
|
// Suppress console output in production
|
||||||
// Must be at the very top before any imports
|
// Must be at the very top before any imports
|
||||||
if (typeof window !== 'undefined' && import.meta.env.PROD) {
|
if (typeof window !== 'undefined' && import.meta.env.PROD) {
|
||||||
|
// Suppress console.log, debug, info in production
|
||||||
|
const noop = () => {};
|
||||||
|
console.log = noop;
|
||||||
|
console.debug = noop;
|
||||||
|
console.info = noop;
|
||||||
|
|
||||||
|
// Filter noisy warnings but keep important ones
|
||||||
const originalWarn = console.warn;
|
const originalWarn = console.warn;
|
||||||
const suppressedPatterns = [
|
const suppressedPatterns = [
|
||||||
'RPC methods not decorated',
|
'RPC methods not decorated',
|
||||||
|
|||||||
Reference in New Issue
Block a user