Cette commande : log show --predicate "(process == 'MyApplication')" --source --last 30m
Produit cette sortie :
Filtering the log data using "process == "MyApplication""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp Thread Type Activity PID TTL
2019-05-08 10:41:36.408613-0700 0xae7b3 Default 0x0 18184 0 <MyApplication`main (main.m:251)> MyApplication: Starting MyApplication...
2019-05-08 10:41:36.413500-0700 0xae7b3 Activity 0x2f8b0 18184 0 MyApplication: (libsystem_info.dylib) Retrieve User by ID
2019-05-08 10:41:36.583272-0700 0xae7b3 Default 0x0 18184 0 <AppKit`_NSAppearanceCurrentSystemAppearance> MyApplication: (AppKit) [com.apple.AppKit:Appearance] Current system appearance, (HLTB: 1), (SLS: 0)
2019-05-08 10:41:36.587974-0700 0xae7b3 Default 0x0 18184 0 <AppKit`-[NSSystemAppearanceProxy init]> MyApplication: (AppKit) [com.apple.AppKit:Appearance] Post-registration system appearance: (HLTB: 1)
2019-05-08 10:41:36.612534-0700 0xae7c3 Activity 0x2f8b1 18184 0 MyApplication: (TCC) TCCAccessRequest() IPC
2019-05-08 10:41:36.705042-0700 0xae7c3 Default 0x0 18184 0 <MyApplication`__24-[MyApplication start]_block_invoke (main.m:181)> MyApplication: No launch path specified.
2019-05-08 10:41:36.705397-0700 0xae7b3 Default 0x0 18184 0 <MyApplication`main (main.m:274)> MyApplication: Exiting MyApplication with code: 0
2019-05-08 10:41:37.211301-0700 0xae7d6 Default 0x0 18185 0 <MyApplication`main (main.m:251)> MyApplication: Starting MyApplication...
2019-05-08 10:41:37.215118-0700 0xae7d6 Activity 0x2f8d0 18185 0 MyApplication: (libsystem_info.dylib) Retrieve User by ID
2019-05-08 10:41:37.293101-0700 0xae7d6 Default 0x0 18185 0 <AppKit`_NSAppearanceCurrentSystemAppearance> MyApplication: (AppKit) [com.apple.AppKit:Appearance] Current system appearance, (HLTB: 1), (SLS: 0)
2019-05-08 10:41:37.299551-0700 0xae7d6 Default 0x0 18185 0 <AppKit`-[NSSystemAppearanceProxy init]> MyApplication: (AppKit) [com.apple.AppKit:Appearance] Post-registration system appearance: (HLTB: 1)
2019-05-08 10:41:37.312224-0700 0xae7d7 Default 0x0 18185 0 <MyApplication`__24-[MyApplication start]_block_invoke (main.m:192)> MyApplication: Launching
2019-05-08 10:41:37.312500-0700 0xae7d7 Default 0x0 18185 0 <MyApplication`AsyncRelayNSPipeToUnixSocketPath (RelayNSPipeToUnixSocket.m:28)> MyApplication: Connected to unix socket path.
2019-05-08 10:41:37.316758-0700 0xae7d7 Default 0x0 18185 0 <MyApplication`__24-[MyApplication start]_block_invoke (main.m:217)> MyApplication: pid: 18186
2019-05-08 10:41:40.270068-0700 0xae7d6 Default 0x0 18185 0 <MyApplication`main (main.m:274)> MyApplication: Exiting MyApplication with code: 0
--------------------------------------------------------------------------------------------------------------------
Log - Default: 12, Info: 0, Debug: 0, Error: 0, Fault: 0
Activity - Create: 3, Transition: 0, Actions: 0
Mon problème réel est que lorsque j'utilise un intervalle de temps très long, la commande prend beaucoup de temps à s'exécuter parce qu'il y a une quantité écrasante de journaux provenant des bibliothèques du système, donc utiliser grep ne serait pas utile, je préférerais filtrer à partir de la commande de journal réelle.
Filtrage avec messageType == 'default'
en supprime certains mais pas la plupart. Ajout du prédicat subsystem == ''
ne fait rien apparaître, et subsystem == null
produit l'erreur :
log: invalid predicate:
*** -[__NSSetM addObject:]: object cannot be nil
Existe-t-il un moyen de filtrer les journaux de la bibliothèque avec un prédicat ou un autre argument ?