NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

[FR] setting loglevel through nsconfig #4603

Open farfromrefug opened 5 years ago

farfromrefug commented 5 years ago

I have an issue with the ios run and logging level. When i run it on my device (need to check on the simulator but i think it is the same) i see a lot of "polluting" logs which makes it almost impossible to see the JS logs:

ay  9 10:21:55 IPhone-Martin Mini2SmartApp(CoreFoundation)[297] <Debug>: Bundle: <private>, key: start_pairing, value: start_pairing, table: Localizable, localizationName: (null), result: start pairing
May  9 10:21:55 IPhone-Martin Mini2SmartApp(CoreFoundation)[297] <Debug>: Bundle: <private>, key: __, value: , table: Localizable, localizationName: (null), result: __
May  9 10:21:55 IPhone-Martin Mini2SmartApp(CoreBluetooth)[297] <Debug>: Sending XPC message <private>: <private>
May  9 10:21:56 IPhone-Martin Mini2SmartApp(CoreBluetooth)[297] <Debug>: Sending XPC message <private>: <private>
May  9 10:21:56 IPhone-Martin Mini2SmartApp(CoreBluetooth)[297] <Debug>: Sending XPC message <private>: <private>
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Info>: nw_endpoint_flow_protocol_connected [3.1 35.231.145.151:443 in_progress socket-flow (satisfied)] Output protocol connected
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Debug>: nw_endpoint_flow_connected_path_change [3.1 35.231.145.151:443 ready socket-flow (satisfied)]
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Info>: nw_endpoint_flow_connected_path_change [3.1 35.231.145.151:443 ready socket-flow (satisfied)] Connected path is satisfied
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Debug>: nw_endpoint_resolver_receive_report [3 gitlab.com:443 in_progress resolver (satisfied)] received child report:[3.1 35.231.145.151:443 ready socket-flow (satisfied)]
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Info>: nw_connection_endpoint_report [3.1 35.231.145.151:443 ready socket-flow (satisfied)] reported event flow:finish_connect
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Info>: nw_connection_endpoint_report [3 gitlab.com:443 ready resolver (satisfied)] reported event flow:finish_connect
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Debug>: __tcp_connection_start_block_invoke 3 sending event TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE in response to state ready and error (null)
May  9 10:22:11 IPhone-Martin Mini2SmartApp(libsystem_network.dylib)[302] <Debug>: tcp_connection_event_notify 3 event: TCP_CONNECTION_EVENT_TLS_HANDSHAKE_COMPLETE, reason: nw_connection event, should deliver: true
TIC TCP Conn Event [3:0x17418a690]: 8 Err(0)

I think i actually see all the device logs. Could we have a way to set the loglevel through nsconfig? Would it filter those?

farfromrefug commented 5 years ago

Actually just saw --log in a PR. Tested it and it filter console logs only. I always get those polluting logs. Trying to see how to filter them by modifying https://github.com/NativeScript/nativescript-cli/blob/master/lib/common/mobile/ios/ios-log-filter.ts