Cannot disable capacitor plugin logging in web inspector
Asked Answered
S

3

7

I am using Capacitor storage to get and set values as seen here https://capacitorjs.com/docs/apis/storage Everything functions correctly however I am getting a large volume of console messages while developing using xcode simulator and safari web inspector, every time I get and set values:

>native Storage.get (#284123)
>native Storage.get (#284124)
>native Storage.get (#284125)
>result Storage.get (#284123)
>native Storage.get (#284126)

My app performs many hundred of these operations.

Tried disabling these logs as described here but still logging

https://github.com/ionic-team/capacitor/issues/2438

"hideLogs": true

or

"ios": {
    "hideLogs": true
}

in capacitor.config.json not disabling

it even mentions it here in official docs, but doesn't work, any ideas? https://capacitorjs.com/docs/reference/config

https://capacitorjs.com/docs/apis/console

Thanks

Sufferable answered 7/8, 2020 at 6:45 Comment(0)
S
2

Well.. updating to help any other poor souls out there struggling with capacitor console.log torture in need of a solution...

Ended up going to native-bridge.js file for project

commented out entire functions for:
capacitor.logToNative
capacitor.logFromNative

cli -> npx capacitor sync

Thankyou capacitor for your pages of logs that clogged my system and overheated my cpu.. enough said now... please be quiet.

Thankyou!

Sufferable answered 7/8, 2020 at 13:21 Comment(0)
M
9

In Capacitor 3 you can use loggingBehavior config and set it to none:

"loggingBehavior": "none"
Magnusson answered 14/6, 2021 at 14:22 Comment(1)
For those who (like me) don't know exactly where to place this line: do it in capacitor.config.ts in the root of config constant. See Capacitor referenceAdulterant
S
2

Well.. updating to help any other poor souls out there struggling with capacitor console.log torture in need of a solution...

Ended up going to native-bridge.js file for project

commented out entire functions for:
capacitor.logToNative
capacitor.logFromNative

cli -> npx capacitor sync

Thankyou capacitor for your pages of logs that clogged my system and overheated my cpu.. enough said now... please be quiet.

Thankyou!

Sufferable answered 7/8, 2020 at 13:21 Comment(0)
P
2

Capacitor 3+

https://capacitorjs.com/docs/config#schema

capacitor.config.json

{
    "loggingBehavior" : "none"
}

This is Deprecated now: i.e. Capacitor 2

It is here: https://capacitorjs.com/docs/v2/apis/console

capacitor.config.json

{
    
    "hideLogs": true,
    
}
Phytosociology answered 20/3, 2022 at 17:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.