2019-01-15 21:49:53 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
2022-08-10 03:28:29 +02:00
|
|
|
// Copyright (C) 2016-2022 Jason Volk <jason@zemos.net>
|
2019-01-15 21:49:53 +01:00
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
2022-08-10 03:28:29 +02:00
|
|
|
#define HAVE_IRCD_M_PRETTY_H
|
2019-01-15 21:49:53 +01:00
|
|
|
|
|
|
|
namespace ircd::m
|
|
|
|
{
|
2022-08-10 04:18:57 +02:00
|
|
|
struct pretty_opts;
|
|
|
|
|
2019-01-15 21:49:53 +01:00
|
|
|
// Informational pretty string condensed to single line.
|
2019-07-26 00:54:44 +02:00
|
|
|
// fmt = 0: w/o content keys, w/ hashes/sigs
|
|
|
|
// fmt = 1: w/ content keys w/ hashes/sigs
|
|
|
|
// fmt = 2: w/o content keys w/o hashes/sigs
|
|
|
|
std::ostream &pretty_oneline(std::ostream &, const event &, const int &fmt = 1);
|
|
|
|
std::string pretty_oneline(const event &, const int &fmt = 1);
|
2019-01-15 21:49:53 +01:00
|
|
|
|
|
|
|
// Informational pretty string on multiple lines.
|
|
|
|
std::ostream &pretty(std::ostream &, const event &);
|
|
|
|
std::string pretty(const event &);
|
|
|
|
|
|
|
|
// Informational content-oriented
|
2022-08-10 04:18:57 +02:00
|
|
|
std::ostream &pretty_msgline(std::ostream &, const event &, const pretty_opts &);
|
|
|
|
std::string pretty_msgline(const event &, const pretty_opts &);
|
2019-08-21 09:34:31 +02:00
|
|
|
|
|
|
|
// Informational pretty for state
|
|
|
|
// io=true will run db queries to enhance w/ more information.
|
2019-08-21 11:30:17 +02:00
|
|
|
std::ostream &pretty_stateline(std::ostream &, const event &, const event::idx & = 0);
|
2020-05-01 18:11:45 +02:00
|
|
|
|
|
|
|
// Pretty detailed information; not so pretty right now though...
|
|
|
|
// note: lots of queries.
|
|
|
|
std::ostream &pretty_detailed(std::ostream &, const event &, const event::idx &);
|
2019-01-15 21:49:53 +01:00
|
|
|
}
|
2022-08-10 04:18:57 +02:00
|
|
|
|
|
|
|
struct ircd::m::pretty_opts
|
|
|
|
{
|
|
|
|
event::idx event_idx {0};
|
|
|
|
|
|
|
|
bool show_event_idx {true};
|
|
|
|
bool show_depth {true};
|
|
|
|
bool show_origin_server_ts {true};
|
2022-08-19 20:13:57 +02:00
|
|
|
bool show_origin_server_ts_ago {false};
|
2022-08-10 04:18:57 +02:00
|
|
|
bool show_event_id {true};
|
|
|
|
bool show_sender {true};
|
|
|
|
bool show_state_key {true};
|
|
|
|
bool show_content {true};
|
|
|
|
bool show_msgtype {true};
|
2022-08-19 20:13:57 +02:00
|
|
|
char body_delim {':'};
|
2022-08-10 04:18:57 +02:00
|
|
|
};
|