2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2013-01-14 18:16:50 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-03 20:40:02 +01:00
|
|
|
#include "json.h"
|
2016-04-20 19:37:46 +02:00
|
|
|
#include "macro.h"
|
|
|
|
|
2013-01-14 18:16:50 +01:00
|
|
|
typedef enum OutputMode {
|
|
|
|
OUTPUT_SHORT,
|
2016-08-04 01:45:07 +02:00
|
|
|
OUTPUT_SHORT_FULL,
|
2013-07-18 10:21:45 +02:00
|
|
|
OUTPUT_SHORT_ISO,
|
2017-05-08 02:23:49 +02:00
|
|
|
OUTPUT_SHORT_ISO_PRECISE,
|
2013-08-04 15:04:20 +02:00
|
|
|
OUTPUT_SHORT_PRECISE,
|
|
|
|
OUTPUT_SHORT_MONOTONIC,
|
2016-04-20 19:46:37 +02:00
|
|
|
OUTPUT_SHORT_UNIX,
|
2013-01-14 18:16:50 +01:00
|
|
|
OUTPUT_VERBOSE,
|
|
|
|
OUTPUT_EXPORT,
|
|
|
|
OUTPUT_JSON,
|
|
|
|
OUTPUT_JSON_PRETTY,
|
|
|
|
OUTPUT_JSON_SSE,
|
2018-07-23 20:22:30 +02:00
|
|
|
OUTPUT_JSON_SEQ,
|
2013-01-14 18:16:50 +01:00
|
|
|
OUTPUT_CAT,
|
2018-05-22 13:22:00 +02:00
|
|
|
OUTPUT_WITH_UNIT,
|
2013-01-14 18:16:50 +01:00
|
|
|
_OUTPUT_MODE_MAX,
|
|
|
|
_OUTPUT_MODE_INVALID = -1
|
|
|
|
} OutputMode;
|
|
|
|
|
2018-12-03 20:43:07 +01:00
|
|
|
static inline bool OUTPUT_MODE_IS_JSON(OutputMode m) {
|
|
|
|
return IN_SET(m, OUTPUT_JSON, OUTPUT_JSON_PRETTY, OUTPUT_JSON_SSE, OUTPUT_JSON_SEQ);
|
|
|
|
}
|
|
|
|
|
2016-04-20 16:06:58 +02:00
|
|
|
/* The output flags definitions are shared by the logs and process tree output. Some apply to both, some only to the
|
|
|
|
* logs output, others only to the process tree output. */
|
|
|
|
|
2013-01-14 18:16:50 +01:00
|
|
|
typedef enum OutputFlags {
|
|
|
|
OUTPUT_SHOW_ALL = 1 << 0,
|
2020-02-29 22:31:38 +01:00
|
|
|
OUTPUT_WARN_CUTOFF = 1 << 1,
|
|
|
|
OUTPUT_FULL_WIDTH = 1 << 2,
|
|
|
|
OUTPUT_COLOR = 1 << 3,
|
|
|
|
OUTPUT_CATALOG = 1 << 4,
|
|
|
|
OUTPUT_BEGIN_NEWLINE = 1 << 5,
|
|
|
|
OUTPUT_UTC = 1 << 6,
|
|
|
|
OUTPUT_KERNEL_THREADS = 1 << 7,
|
|
|
|
OUTPUT_NO_HOSTNAME = 1 << 8,
|
2013-01-14 18:16:50 +01:00
|
|
|
} OutputFlags;
|
2016-04-20 19:37:46 +02:00
|
|
|
|
2018-12-03 20:40:02 +01:00
|
|
|
JsonFormatFlags output_mode_to_json_format_flags(OutputMode m);
|
|
|
|
|
2016-04-20 19:37:46 +02:00
|
|
|
const char* output_mode_to_string(OutputMode m) _const_;
|
|
|
|
OutputMode output_mode_from_string(const char *s) _pure_;
|