| index 74baf48..d8ad7d8 100644 | | index 74baf48..d8ad7d8 100644 |
| --- a/src/plugin_logs.c | | --- a/src/plugin_logs.c |
| +++ b/src/plugin_logs.c | | +++ b/src/plugin_logs.c |
| @@ -1164,15 +1164,17 @@ static int collect_tail(const src_t *s, int nlines, ring_t *ring) | | @@ -1164,15 +1164,17 @@ static int collect_tail(const src_t *s, int nlines, ring_t *ring) |
| 1164 | shell_ctx_t ctx; | 1164 | shell_ctx_t ctx; |
| 1165 | | 1165 | |
| 1166 | ctx.ring = ring; | 1166 | ctx.ring = ring; |
| | 1167 | + /* Platform first: on macOS the "journal" kind is `log show`, not |
| | 1168 | + * journalctl, and the generic branch below would swallow it. */ |
| | 1169 | +#if defined(__APPLE__) |
| 1167 | if (strcmp(s->kind, "journal") == 0) | 1170 | if (strcmp(s->kind, "journal") == 0) |
| 1168 | - return stream_journal(NULL, nlines, NULL, shell_sink, &ctx); | 1171 | + return stream_macos_log(nlines, NULL, shell_sink, &ctx); |
| 1169 | -#if defined(_WIN32) | 1172 | +#elif defined(_WIN32) |
| 1170 | if (strncmp(s->id, "event:", 6) == 0) | 1173 | if (strncmp(s->id, "event:", 6) == 0) |
| 1171 | return stream_event_log(s->id + 6, nlines, NULL, shell_sink, &ctx); | 1174 | return stream_event_log(s->id + 6, nlines, NULL, shell_sink, &ctx); |
| 1172 | -#endif | 1175 | +#else |
| 1173 | -#if defined(__APPLE__) | | |
| 1174 | if (strcmp(s->kind, "journal") == 0) | 1176 | if (strcmp(s->kind, "journal") == 0) |
| 1175 | - return stream_macos_log(nlines, NULL, shell_sink, &ctx); | 1177 | + return stream_journal(NULL, nlines, NULL, shell_sink, &ctx); |
| 1176 | #endif | 1178 | #endif |
| 1177 | if (strncmp(s->id, "file:", 5) == 0) | 1179 | if (strncmp(s->id, "file:", 5) == 0) |
| 1178 | return read_log_file(s->id + 5, nlines, NULL, ring, NULL, 0); | 1180 | return read_log_file(s->id + 5, nlines, NULL, ring, NULL, 0); |
| @@ -1197,11 +1199,16 @@ static int collect_search(const src_t *s, const char *filter, list_t *hits) | | @@ -1197,11 +1199,16 @@ static int collect_search(const src_t *s, const char *filter, list_t *hits) |
| 1197 | hits_ctx_t ctx; | 1199 | hits_ctx_t ctx; |
| 1198 | | 1200 | |
| 1199 | ctx.hits = hits; | 1201 | ctx.hits = hits; |
| | 1202 | + /* same platform-first order as collect_tail */ |
| | 1203 | +#if defined(__APPLE__) |
| 1200 | if (strcmp(s->kind, "journal") == 0) | 1204 | if (strcmp(s->kind, "journal") == 0) |
| 1201 | - return stream_journal(NULL, TAIL_MAX, filter, hits_sink, &ctx); | 1205 | + return stream_macos_log(TAIL_MAX, filter, hits_sink, &ctx); |
| 1202 | -#if defined(_WIN32) | 1206 | +#elif defined(_WIN32) |
| 1203 | if (strncmp(s->id, "event:", 6) == 0) | 1207 | if (strncmp(s->id, "event:", 6) == 0) |
| 1204 | return stream_event_log(s->id + 6, 600, filter, hits_sink, &ctx); | 1208 | return stream_event_log(s->id + 6, 600, filter, hits_sink, &ctx); |
| | 1209 | +#else |
| | 1210 | + if (strcmp(s->kind, "journal") == 0) |
| | 1211 | + return stream_journal(NULL, TAIL_MAX, filter, hits_sink, &ctx); |
| 1205 | #endif | 1212 | #endif |
| 1206 | if (strncmp(s->id, "file:", 5) == 0) | 1213 | if (strncmp(s->id, "file:", 5) == 0) |
| 1207 | return read_log_file(s->id + 5, TAIL_MAX, filter, NULL, hits, SEARCH_HITS_MAX); | 1214 | return read_log_file(s->id + 5, TAIL_MAX, filter, NULL, hits, SEARCH_HITS_MAX); |
| 1208 | | 1215 | |