Este comando:
log show --predicate "(process == 'MyApplication')" --source --last 30m
Produce la siguiente salida:
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
Mi problema real es que cuando se utiliza un muy largo periodo de tiempo, el comando tarda mucho tiempo en ejecutarse porque hay una abrumadora cantidad de registros de las bibliotecas del sistema, por lo que el uso de grep no sería de ayuda, prefiero el filtro de la real registro de comando.
El filtrado con messageType == 'default'
elimina algunos, pero no a la mayoría. Agregar el predicado subsystem == ''
hace nada para mostrar y subsystem == null
produce el mensaje de error:
log: invalid predicate:
*** -[__NSSetM addObject:]: object cannot be nil
Hay una forma de filtrar la biblioteca de registros con un predicado o otro argumento?