]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/logs-show.h
journalctl: hightlight log lines by priority
[thirdparty/systemd.git] / src / shared / logs-show.h
CommitLineData
86aa7ba4
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
c2f1db8f 3#pragma once
86aa7ba4
LP
4
5/***
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
86aa7ba4
LP
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 18 Lesser General Public License for more details.
86aa7ba4 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
86aa7ba4
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <stdbool.h>
25
81527be1
LP
26#include <systemd/sd-journal.h>
27
86aa7ba4
LP
28#include "util.h"
29
df50185b 30typedef enum OutputMode {
86aa7ba4 31 OUTPUT_SHORT,
67a12205 32 OUTPUT_SHORT_MONOTONIC,
86aa7ba4
LP
33 OUTPUT_VERBOSE,
34 OUTPUT_EXPORT,
35 OUTPUT_JSON,
d3f2bdbf 36 OUTPUT_CAT,
df50185b
LP
37 _OUTPUT_MODE_MAX,
38 _OUTPUT_MODE_INVALID = -1
39} OutputMode;
86aa7ba4 40
25277cd7 41typedef enum OutputFlags {
49826187 42 OUTPUT_SHOW_ALL = 1 << 0,
25277cd7 43 OUTPUT_MONOTONIC_MODE = 1 << 1,
49826187
LP
44 OUTPUT_FOLLOW = 1 << 2,
45 OUTPUT_WARN_CUTOFF = 1 << 3,
46 OUTPUT_FULL_WIDTH = 1 << 4,
47 OUTPUT_COLOR = 1 << 5
25277cd7
ZJS
48} OutputFlags;
49
50int output_journal(sd_journal *j, OutputMode mode, unsigned line,
51 unsigned n_columns, OutputFlags flags);
86aa7ba4 52
df50185b
LP
53int show_journal_by_unit(
54 const char *unit,
55 OutputMode mode,
86aa7ba4
LP
56 unsigned n_columns,
57 usec_t not_before,
58 unsigned how_many,
085d7120 59 OutputFlags flags);
df50185b
LP
60
61const char* output_mode_to_string(OutputMode m);
62OutputMode output_mode_from_string(const char *s);