MCPcopy Create free account
hub / github.com/ceph/ceph / print

Method print

src/messages/MMonCommand.h:56–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54public:
55 std::string_view get_type_name() const override { return "mon_command"; }
56 void print(std::ostream& o) const override {
57 cmdmap_t cmdmap;
58 std::ostringstream ss;
59 std::string prefix;
60 cmdmap_from_json(cmd, &cmdmap, ss);
61 cmd_getval(cmdmap, "prefix", prefix);
62 // Some config values contain sensitive data, so don't log them
63 o << "mon_command(";
64 if (prefix == "config set") {
65 std::string name;
66 cmd_getval(cmdmap, "name", name);
67 o << "[{prefix=" << prefix << ", name=" << name << "}]";
68 } else if (prefix == "config-key set") {
69 std::string key;
70 cmd_getval(cmdmap, "key", key);
71 o << "[{prefix=" << prefix << ", key=" << key << "}]";
72 } else {
73 for (unsigned i=0; i<cmd.size(); i++) {
74 if (i) o << ' ';
75 o << cmd[i];
76 }
77 }
78 o << " v " << version << ")";
79 }
80
81 void encode_payload(uint64_t features) override {
82 using ceph::encode;

Callers

nothing calls this directly

Calls 3

cmdmap_from_jsonFunction · 0.85
cmd_getvalFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected