2012-01-03 21:08:28 +01:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2012-01-03 21:08:28 +01:00
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2012 Lennart Poettering
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
2012-04-12 00:20:58 +02:00
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2012-01-03 21:08:28 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2012-04-12 00:20:58 +02:00
|
|
|
Lesser General Public License for more details.
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2012-04-12 00:20:58 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2012-01-03 21:08:28 +01:00
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2012-01-05 16:01:58 +01:00
|
|
|
#include <systemd/sd-journal.h>
|
|
|
|
|
2012-01-03 21:08:28 +01:00
|
|
|
#include "util.h"
|
|
|
|
|
2012-01-04 18:33:36 +01:00
|
|
|
typedef enum OutputMode {
|
2012-01-03 21:08:28 +01:00
|
|
|
OUTPUT_SHORT,
|
2012-01-07 04:41:30 +01:00
|
|
|
OUTPUT_SHORT_MONOTONIC,
|
2012-01-03 21:08:28 +01:00
|
|
|
OUTPUT_VERBOSE,
|
|
|
|
OUTPUT_EXPORT,
|
|
|
|
OUTPUT_JSON,
|
2012-09-06 00:25:32 +02:00
|
|
|
OUTPUT_JSON_PRETTY,
|
2012-01-13 02:58:45 +01:00
|
|
|
OUTPUT_CAT,
|
2012-01-04 18:33:36 +01:00
|
|
|
_OUTPUT_MODE_MAX,
|
|
|
|
_OUTPUT_MODE_INVALID = -1
|
|
|
|
} OutputMode;
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2012-07-17 07:35:06 +02:00
|
|
|
typedef enum OutputFlags {
|
2012-07-26 16:50:35 +02:00
|
|
|
OUTPUT_SHOW_ALL = 1 << 0,
|
2012-09-06 00:25:32 +02:00
|
|
|
OUTPUT_FOLLOW = 1 << 1,
|
|
|
|
OUTPUT_WARN_CUTOFF = 1 << 2,
|
|
|
|
OUTPUT_FULL_WIDTH = 1 << 3,
|
|
|
|
OUTPUT_COLOR = 1 << 4
|
2012-07-17 07:35:06 +02:00
|
|
|
} OutputFlags;
|
|
|
|
|
2012-09-27 23:27:10 +02:00
|
|
|
int output_journal(
|
|
|
|
FILE *f,
|
|
|
|
sd_journal *j,
|
|
|
|
OutputMode mode,
|
|
|
|
unsigned n_columns,
|
|
|
|
OutputFlags flags);
|
2012-01-03 21:08:28 +01:00
|
|
|
|
2012-01-04 18:33:36 +01:00
|
|
|
int show_journal_by_unit(
|
2012-09-27 23:27:10 +02:00
|
|
|
FILE *f,
|
2012-01-04 18:33:36 +01:00
|
|
|
const char *unit,
|
|
|
|
OutputMode mode,
|
2012-01-03 21:08:28 +01:00
|
|
|
unsigned n_columns,
|
|
|
|
usec_t not_before,
|
|
|
|
unsigned how_many,
|
2012-07-17 07:35:07 +02:00
|
|
|
OutputFlags flags);
|
2012-01-04 18:33:36 +01:00
|
|
|
|
|
|
|
const char* output_mode_to_string(OutputMode m);
|
|
|
|
OutputMode output_mode_from_string(const char *s);
|