]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/logs-show.h
68e234a0ef4e1b688c4462affa49b234e82072ce
[thirdparty/systemd.git] / src / shared / logs-show.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2012 Lennart Poettering
8 ***/
9
10 #include <stdbool.h>
11 #include <stddef.h>
12 #include <stdio.h>
13 #include <sys/types.h>
14
15 #include "sd-journal.h"
16
17 #include "macro.h"
18 #include "output-mode.h"
19 #include "time-util.h"
20 #include "util.h"
21
22 int show_journal_entry(
23 FILE *f,
24 sd_journal *j,
25 OutputMode mode,
26 unsigned n_columns,
27 OutputFlags flags,
28 char **output_fields,
29 size_t highlight[2],
30 bool *ellipsized);
31 int show_journal(
32 FILE *f,
33 sd_journal *j,
34 OutputMode mode,
35 unsigned n_columns,
36 usec_t not_before,
37 unsigned how_many,
38 OutputFlags flags,
39 bool *ellipsized);
40
41 int add_match_this_boot(sd_journal *j, const char *machine);
42
43 int add_matches_for_unit(
44 sd_journal *j,
45 const char *unit);
46
47 int add_matches_for_user_unit(
48 sd_journal *j,
49 const char *unit,
50 uid_t uid);
51
52 int show_journal_by_unit(
53 FILE *f,
54 const char *unit,
55 OutputMode mode,
56 unsigned n_columns,
57 usec_t not_before,
58 unsigned how_many,
59 uid_t uid,
60 OutputFlags flags,
61 int journal_open_flags,
62 bool system_unit,
63 bool *ellipsized);
64
65 void json_escape(
66 FILE *f,
67 const char* p,
68 size_t l,
69 OutputFlags flags);