0

This command: log show --predicate "(process == 'MyApplication')" --source --last 30m

Produces this output:

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

My actual problem is that when using a very long timespan, the command takes a very long time to run because there's such an overwhelming amount of logs from system libraries, so using grep wouldn't help, I'd prefer to filter from the actual log command.

Filtering with messageType == 'default' removes some but not most. Adding the predicate subsystem == '' causes nothing to show, and subsystem == null produces the error:

log: invalid predicate:
*** -[__NSSetM addObject:]: object cannot be nil

Is there a way to filter out the library logs with a predicate or another argument?

1

The predicate senderImagePath ENDSWITH 'MyApplication' does what I am looking for.

The full command being: log show --predicate "(process == 'MyApplication' && senderImagePath ENDSWITH 'MyApplication')" --source --last 30m

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .