CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
log.h File Reference
#include <cstring>
#include <iostream>
#include <memory>
#include <spdlog/fmt/fmt.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
Include dependency graph for log.h:

Go to the source code of this file.

Macros

#define __FILENAME__   (std::strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define cds_debug(fmt, ...)
 
#define cds_warn(fmt, ...)
 
#define cds_error(fmt, ...)
 
#define cds_info(fmt, ...)
 

Variables

std::shared_ptr< spdlog::logger > kDefaultLogger
 

Macro Definition Documentation

◆ __FILENAME__

#define __FILENAME__   (std::strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

◆ cds_debug

#define cds_debug (   fmt,
  ... 
)
Value:
do { \
kDefaultLogger->debug("[{}():{}@{}] " fmt, __FUNCTION__, __FILENAME__, __LINE__, ##__VA_ARGS__); \
} while (0)
std::shared_ptr< spdlog::logger > kDefaultLogger
Definition common_test.cpp:27
#define __FILENAME__
Definition log.h:11

◆ cds_error

#define cds_error (   fmt,
  ... 
)
Value:
do { \
kDefaultLogger->error("[{}():{}@{}] " fmt, __FUNCTION__, __FILENAME__, __LINE__, ##__VA_ARGS__); \
} while (0)

◆ cds_info

#define cds_info (   fmt,
  ... 
)
Value:
do { \
kDefaultLogger->info("[{}():{}@{}] " fmt, __FUNCTION__, __FILENAME__, __LINE__, ##__VA_ARGS__); \
} while (0)

◆ cds_warn

#define cds_warn (   fmt,
  ... 
)
Value:
do { \
kDefaultLogger->warn("[{}():{}@{}] " fmt, __FUNCTION__, __FILENAME__, __LINE__, ##__VA_ARGS__); \
} while (0)

Variable Documentation

◆ kDefaultLogger

std::shared_ptr<spdlog::logger> kDefaultLogger
extern