summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/logging.h
blob: 3f12ee72cfed7f100857039cde0923f9ef43833b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#pragma once

#include <fmt/format.h>

#include "crimson/common/log.h"

#define LOGT(level_, MSG, t, ...) \
  LOCAL_LOGGER.log(level_, "{} trans.{} {}: " MSG, (void*)&t, \
    (t).get_trans_id(), FNAME , ##__VA_ARGS__)
#define SUBLOGT(subname_, level_, MSG, t, ...) \
  LOGGER(subname_).log(level_, "{} trans.{} {}: " MSG, (void*)&t, \
    (t).get_trans_id(), FNAME , ##__VA_ARGS__)

#define TRACET(...) LOGT(seastar::log_level::trace, __VA_ARGS__)
#define SUBTRACET(subname_, ...) SUBLOGT(subname_, seastar::log_level::trace, __VA_ARGS__)

#define DEBUGT(...) LOGT(seastar::log_level::debug, __VA_ARGS__)
#define SUBDEBUGT(subname_, ...) SUBLOGT(subname_, seastar::log_level::debug, __VA_ARGS__)

#define INFOT(...) LOGT(seastar::log_level::info, __VA_ARGS__)
#define SUBINFOT(subname_, ...) SUBLOGT(subname_, seastar::log_level::info, __VA_ARGS__)

#define WARNT(...) LOGT(seastar::log_level::warn, __VA_ARGS__)
#define SUBWARNT(subname_, ...) SUBLOGT(subname_, seastar::log_level::warn, __VA_ARGS__)

#define ERRORT(...) LOGT(seastar::log_level::error, __VA_ARGS__)
#define SUBERRORT(subname_, ...) SUBLOGT(subname_, seastar::log_level::error, __VA_ARGS__)