hikyuu 2.1.0__cp312-none-win_amd64.whl → 2.1.2__cp312-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hikyuu/cpp/boost_date_time-mt.dll +0 -0
- hikyuu/cpp/boost_serialization-mt.dll +0 -0
- hikyuu/cpp/boost_wserialization-mt.dll +0 -0
- hikyuu/cpp/core312.pyd +0 -0
- hikyuu/cpp/hikyuu.dll +0 -0
- hikyuu/cpp/sqlite3.dll +0 -0
- hikyuu/examples/notebook/006-TradeManager.ipynb +41 -39
- hikyuu/examples/notebook/008-Pickle.ipynb +27 -35
- hikyuu/extend.py +3 -1
- hikyuu/fetcher/stock/zh_stock_a_qmt.py +49 -0
- hikyuu/gui/HikyuuTDX.py +13 -7
- hikyuu/gui/data/MainWindow.py +126 -126
- hikyuu/gui/spot_server.py +16 -7
- hikyuu/gui/start_qmt.py +36 -0
- hikyuu/include/hikyuu/DataType.h +2 -1
- hikyuu/include/hikyuu/KRecord.h +1 -1
- hikyuu/include/hikyuu/Stock.h +1 -1
- hikyuu/include/hikyuu/StockManager.h +3 -0
- hikyuu/include/hikyuu/StrategyContext.h +7 -2
- hikyuu/include/hikyuu/analysis/combinate.h +1 -1
- hikyuu/include/hikyuu/config.h +0 -12
- hikyuu/include/hikyuu/data_driver/base_info/table/HistoryFinanceTable.h +2 -2
- hikyuu/include/hikyuu/doc.h +2 -2
- hikyuu/include/hikyuu/global/GlobalSpotAgent.h +1 -0
- hikyuu/include/hikyuu/global/GlobalTaskGroup.h +4 -2
- hikyuu/include/hikyuu/global/SpotRecord.h +52 -0
- hikyuu/include/hikyuu/global/agent/SpotAgent.h +14 -41
- hikyuu/include/hikyuu/hikyuu.h +1 -0
- hikyuu/include/hikyuu/strategy/{AccountTradeManager.h → BrokerTradeManager.h} +97 -95
- hikyuu/include/hikyuu/strategy/RunPortfolioInStrategy.h +36 -0
- hikyuu/include/hikyuu/strategy/RunSystemInStrategy.h +37 -0
- hikyuu/include/hikyuu/strategy/Strategy.h +174 -0
- hikyuu/include/hikyuu/trade_manage/FundsRecord.h +8 -8
- hikyuu/include/hikyuu/trade_manage/OrderBrokerBase.h +66 -14
- hikyuu/include/hikyuu/trade_manage/PositionRecord.h +12 -12
- hikyuu/include/hikyuu/trade_manage/TradeManager.h +9 -0
- hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +19 -0
- hikyuu/include/hikyuu/utilities/FilterNode.h +267 -0
- hikyuu/include/hikyuu/utilities/LRUCache11.h +230 -0
- hikyuu/include/hikyuu/{Log.h → utilities/Log.h} +91 -113
- hikyuu/include/hikyuu/utilities/Null.h +1 -0
- hikyuu/include/hikyuu/utilities/Parameter.h +2 -1
- hikyuu/include/hikyuu/utilities/ResourcePool.h +636 -0
- hikyuu/include/hikyuu/utilities/SpendTimer.h +10 -9
- hikyuu/include/hikyuu/utilities/TimerManager.h +25 -11
- hikyuu/include/hikyuu/utilities/any_to_string.h +142 -0
- hikyuu/include/hikyuu/utilities/arithmetic.h +71 -35
- hikyuu/include/hikyuu/utilities/base64.h +59 -0
- hikyuu/include/hikyuu/utilities/config.h +41 -0
- hikyuu/include/hikyuu/utilities/datetime/Datetime.h +42 -31
- hikyuu/include/hikyuu/utilities/datetime/TimeDelta.h +24 -13
- hikyuu/include/hikyuu/utilities/db_connect/DBCondition.h +48 -48
- hikyuu/include/hikyuu/utilities/db_connect/DBConnect.h +10 -0
- hikyuu/include/hikyuu/utilities/db_connect/DBConnectBase.h +5 -22
- hikyuu/include/hikyuu/utilities/db_connect/DBUpgrade.h +3 -3
- hikyuu/include/hikyuu/utilities/db_connect/SQLException.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/SQLResultSet.h +1 -1
- hikyuu/include/hikyuu/utilities/db_connect/SQLStatementBase.h +7 -7
- hikyuu/include/hikyuu/utilities/db_connect/TableMacro.h +1 -2
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLConnect.h +9 -9
- hikyuu/include/hikyuu/utilities/db_connect/mysql/MySQLStatement.h +18 -18
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteConnect.h +3 -3
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteStatement.h +2 -2
- hikyuu/include/hikyuu/utilities/db_connect/sqlite/SQLiteUtil.h +6 -6
- hikyuu/include/hikyuu/{exception.h → utilities/exception.h} +15 -16
- hikyuu/include/hikyuu/utilities/http_client/HttpClient.h +229 -0
- hikyuu/include/hikyuu/utilities/http_client/nng_wrap.h +517 -0
- hikyuu/include/hikyuu/utilities/http_client/url.h +25 -0
- hikyuu/include/hikyuu/utilities/{IniParser.h → ini_parser/IniParser.h} +10 -5
- hikyuu/include/hikyuu/utilities/ini_parser/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/md5.h +41 -0
- hikyuu/include/hikyuu/utilities/mo/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/mo/mo.h +48 -0
- hikyuu/include/hikyuu/utilities/mo/moFileReader.h +836 -0
- hikyuu/include/hikyuu/{global → utilities}/node/NodeClient.h +25 -18
- hikyuu/include/hikyuu/{global → utilities}/node/NodeError.h +1 -1
- hikyuu/include/hikyuu/{global → utilities}/node/NodeMessage.h +3 -2
- hikyuu/include/hikyuu/utilities/node/NodeServer.h +246 -0
- hikyuu/include/hikyuu/utilities/node/__init__.py +1 -0
- hikyuu/include/hikyuu/utilities/os.h +16 -15
- hikyuu/include/hikyuu/utilities/snowflake.h +110 -0
- hikyuu/include/hikyuu/utilities/string_view.h +70 -0
- hikyuu/include/hikyuu/utilities/thread/MQStealThreadPool.h +3 -3
- hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +3 -3
- hikyuu/include/hikyuu/utilities/thread/StealThreadPool.h +3 -3
- hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +3 -3
- hikyuu/include/hikyuu/version.h +4 -4
- hikyuu/interactive.py +42 -137
- hikyuu/sqlite3.dll +0 -0
- hikyuu/strategy/__init__.py +0 -1
- hikyuu/strategy/strategy_demo1.py +53 -0
- hikyuu/strategy/strategy_demo2.py +47 -0
- hikyuu/strategy/strategy_demo3.py +24 -0
- hikyuu/trade_manage/broker.py +27 -11
- hikyuu/trade_manage/broker_easytrader.py +52 -6
- hikyuu/trade_manage/broker_mail.py +17 -20
- hikyuu/vcruntime140.dll +0 -0
- hikyuu/vcruntime140_1.dll +0 -0
- hikyuu-2.1.2.dist-info/METADATA +115 -0
- {hikyuu-2.1.0.dist-info → hikyuu-2.1.2.dist-info}/RECORD +105 -79
- {hikyuu-2.1.0.dist-info → hikyuu-2.1.2.dist-info}/top_level.txt +4 -2
- hikyuu/README.rst +0 -79
- hikyuu/include/hikyuu/strategy/StrategyBase.h +0 -156
- hikyuu/strategy/demo/__init__.py +0 -3
- hikyuu/strategy/strategy.py +0 -27
- hikyuu-2.1.0.dist-info/METADATA +0 -126
- /hikyuu/include/hikyuu/{global/node → utilities/http_client}/__init__.py +0 -0
- {hikyuu-2.1.0.dist-info → hikyuu-2.1.2.dist-info}/LICENSE +0 -0
- {hikyuu-2.1.0.dist-info → hikyuu-2.1.2.dist-info}/WHEEL +0 -0
- {hikyuu-2.1.0.dist-info → hikyuu-2.1.2.dist-info}/entry_points.txt +0 -0
|
@@ -16,13 +16,19 @@
|
|
|
16
16
|
#include "config.h"
|
|
17
17
|
#include "exception.h"
|
|
18
18
|
|
|
19
|
+
#ifndef HKU_LOG_ACTIVE_LEVEL
|
|
20
|
+
#define HKU_LOG_ACTIVE_LEVEL 0
|
|
21
|
+
#endif
|
|
22
|
+
|
|
19
23
|
// clang-format off
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
#ifndef SPDLOG_ACTIVE_LEVEL
|
|
25
|
+
#define SPDLOG_ACTIVE_LEVEL HKU_LOG_ACTIVE_LEVEL
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#include <spdlog/spdlog.h>
|
|
29
|
+
#include <spdlog/fmt/ostr.h>
|
|
30
|
+
#if HKU_USE_SPDLOG_ASYNC_LOGGER
|
|
31
|
+
#include "spdlog/async.h"
|
|
26
32
|
#endif
|
|
27
33
|
// clang-format on
|
|
28
34
|
|
|
@@ -30,30 +36,24 @@
|
|
|
30
36
|
#include <fmt/format.h>
|
|
31
37
|
#include <fmt/chrono.h>
|
|
32
38
|
|
|
33
|
-
#
|
|
39
|
+
#ifndef HKU_ENABLE_STACK_TRACE
|
|
40
|
+
#define HKU_ENABLE_STACK_TRACE 0
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#if HKU_ENABLE_STACK_TRACE
|
|
34
44
|
#include <boost/stacktrace.hpp>
|
|
35
45
|
#endif
|
|
36
46
|
|
|
37
|
-
#ifndef
|
|
38
|
-
#define
|
|
47
|
+
#ifndef HKU_UTILS_API
|
|
48
|
+
#define HKU_UTILS_API
|
|
39
49
|
#endif
|
|
40
50
|
|
|
41
51
|
namespace hku {
|
|
42
52
|
|
|
43
|
-
/**
|
|
44
|
-
* @ingroup Utilities
|
|
45
|
-
* @addtogroup logging Logging tools 日志工具
|
|
46
|
-
* @details 打印等级:
|
|
47
|
-
* TRACE < DEBUG < INFO < WARN < ERROR < FATAL
|
|
48
|
-
* @{
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
bool HKU_API isLogInMainThread();
|
|
52
|
-
|
|
53
53
|
/**********************************************
|
|
54
54
|
* Use SPDLOG for logging
|
|
55
55
|
*********************************************/
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
/** 日志级别 */
|
|
58
58
|
enum LOG_LEVEL {
|
|
59
59
|
LOG_TRACE = SPDLOG_LEVEL_TRACE, ///< 跟踪
|
|
@@ -65,19 +65,27 @@ enum LOG_LEVEL {
|
|
|
65
65
|
LOG_OFF = SPDLOG_LEVEL_OFF, ///< 关闭日志打印
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* 初始化 logger
|
|
70
|
+
* @param not_use_color 不使用彩色输出
|
|
71
|
+
* @param filename 日志文件名,为空时默认为当前目录下 "./hikyuu.log",需自行保存存放目录存在且可写入
|
|
72
|
+
*/
|
|
73
|
+
void HKU_UTILS_API initLogger(bool not_use_color = false,
|
|
74
|
+
const std::string& filename = std::string());
|
|
75
|
+
|
|
68
76
|
/**
|
|
69
77
|
* 获取当前日志级别
|
|
70
78
|
* @return
|
|
71
79
|
*/
|
|
72
|
-
LOG_LEVEL
|
|
80
|
+
LOG_LEVEL HKU_UTILS_API get_log_level();
|
|
73
81
|
|
|
74
82
|
/**
|
|
75
83
|
* 设置日志级别
|
|
76
84
|
* @param level 指定的日志级别
|
|
77
85
|
*/
|
|
78
|
-
void
|
|
86
|
+
void HKU_UTILS_API set_log_level(LOG_LEVEL level);
|
|
79
87
|
|
|
80
|
-
std::shared_ptr<spdlog::logger>
|
|
88
|
+
std::shared_ptr<spdlog::logger> HKU_UTILS_API getHikyuuLogger();
|
|
81
89
|
|
|
82
90
|
#define HKU_TRACE(...) SPDLOG_LOGGER_TRACE(hku::getHikyuuLogger(), __VA_ARGS__)
|
|
83
91
|
#define HKU_DEBUG(...) SPDLOG_LOGGER_DEBUG(hku::getHikyuuLogger(), __VA_ARGS__)
|
|
@@ -86,76 +94,6 @@ std::shared_ptr<spdlog::logger> HKU_API getHikyuuLogger();
|
|
|
86
94
|
#define HKU_ERROR(...) SPDLOG_LOGGER_ERROR(hku::getHikyuuLogger(), __VA_ARGS__)
|
|
87
95
|
#define HKU_FATAL(...) SPDLOG_LOGGER_CRITICAL(hku::getHikyuuLogger(), __VA_ARGS__)
|
|
88
96
|
|
|
89
|
-
void initLogger(bool inJupyter = false);
|
|
90
|
-
|
|
91
|
-
#else
|
|
92
|
-
enum LOG_LEVEL {
|
|
93
|
-
LOG_TRACE = 0,
|
|
94
|
-
LOG_DEBUG = 1,
|
|
95
|
-
LOG_INFO = 2,
|
|
96
|
-
LOG_WARN = 3,
|
|
97
|
-
LOG_ERROR = 4,
|
|
98
|
-
LOG_FATAL = 5,
|
|
99
|
-
LOG_OFF = 6,
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
LOG_LEVEL HKU_API get_log_level();
|
|
103
|
-
void HKU_API set_log_level(LOG_LEVEL level);
|
|
104
|
-
void initLogger(bool inJupyter = false);
|
|
105
|
-
|
|
106
|
-
/** 获取系统当前时间,精确到毫秒,如:2001-01-02 13:01:02.001 */
|
|
107
|
-
std::string HKU_API getLocalTime();
|
|
108
|
-
|
|
109
|
-
#if LOG_ACTIVE_LEVEL <= 0
|
|
110
|
-
#define HKU_TRACE(...) \
|
|
111
|
-
fmt::print("[{}] [HKU-T] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
112
|
-
__LINE__);
|
|
113
|
-
#else
|
|
114
|
-
#define HKU_TRACE(...)
|
|
115
|
-
#endif
|
|
116
|
-
|
|
117
|
-
#if LOG_ACTIVE_LEVEL <= 1
|
|
118
|
-
#define HKU_DEBUG(...) \
|
|
119
|
-
fmt::print("[{}] [HKU-D] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
120
|
-
__LINE__);
|
|
121
|
-
#else
|
|
122
|
-
#define HKU_DEBUG(...)
|
|
123
|
-
#endif
|
|
124
|
-
|
|
125
|
-
#if LOG_ACTIVE_LEVEL <= 2
|
|
126
|
-
#define HKU_INFO(...) \
|
|
127
|
-
fmt::print("[{}] [HKU-I] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
128
|
-
__LINE__);
|
|
129
|
-
#else
|
|
130
|
-
#define HKU_INFO(...)
|
|
131
|
-
#endif
|
|
132
|
-
|
|
133
|
-
#if LOG_ACTIVE_LEVEL <= 3
|
|
134
|
-
#define HKU_WARN(...) \
|
|
135
|
-
fmt::print("[{}] [HKU-W] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
136
|
-
__LINE__);
|
|
137
|
-
#else
|
|
138
|
-
#define HKU_WARN(...)
|
|
139
|
-
#endif
|
|
140
|
-
|
|
141
|
-
#if LOG_ACTIVE_LEVEL <= 4
|
|
142
|
-
#define HKU_ERROR(...) \
|
|
143
|
-
fmt::print("[{}] [HKU-E] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
144
|
-
__LINE__);
|
|
145
|
-
#else
|
|
146
|
-
#define HKU_ERROR(...)
|
|
147
|
-
#endif
|
|
148
|
-
|
|
149
|
-
#if LOG_ACTIVE_LEVEL <= 5
|
|
150
|
-
#define HKU_FATAL(...) \
|
|
151
|
-
fmt::print("[{}] [HKU-F] - {} ({}:{})\n", getLocalTime(), fmt::format(__VA_ARGS__), __FILE__, \
|
|
152
|
-
__LINE__);
|
|
153
|
-
#else
|
|
154
|
-
#define HKU_FATAL(...)
|
|
155
|
-
#endif
|
|
156
|
-
|
|
157
|
-
#endif /* USE_SPDLOG_LOGGER */
|
|
158
|
-
|
|
159
97
|
///////////////////////////////////////////////////////////////////////////////
|
|
160
98
|
//
|
|
161
99
|
// clang/gcc 下使用 __PRETTY_FUNCTION__ 会包含函数参数,可以在编译时指定
|
|
@@ -166,7 +104,7 @@ std::string HKU_API getLocalTime();
|
|
|
166
104
|
#define HKU_FUNCTION __FUNCTION__
|
|
167
105
|
#endif
|
|
168
106
|
|
|
169
|
-
#
|
|
107
|
+
#if !HKU_ENABLE_STACK_TRACE
|
|
170
108
|
/**
|
|
171
109
|
* 若表达式为 false,将抛出 hku::exception 异常, 并附带传入信息
|
|
172
110
|
* @note 用于外部入参及结果检查
|
|
@@ -212,23 +150,9 @@ std::string HKU_API getLocalTime();
|
|
|
212
150
|
__FILE__, __LINE__)); \
|
|
213
151
|
} \
|
|
214
152
|
} while (0)
|
|
215
|
-
#endif // #
|
|
153
|
+
#endif // #if !HKU_ENABLE_STACK_TRACE
|
|
216
154
|
|
|
217
|
-
#if
|
|
218
|
-
#define HKU_ASSERT_DEBUG(expr)
|
|
219
|
-
#else
|
|
220
|
-
/** 仅在 debug 模式下生效 */
|
|
221
|
-
#define HKU_ASSERT_DEBUG(expr) \
|
|
222
|
-
do { \
|
|
223
|
-
if (!(expr)) { \
|
|
224
|
-
std::string err_msg(fmt::format("HKU_ASSERT({})", #expr)); \
|
|
225
|
-
throw hku::exception( \
|
|
226
|
-
fmt::format("{} [{}] ({}:{})", err_msg, HKU_FUNCTION, __FILE__, __LINE__)); \
|
|
227
|
-
} \
|
|
228
|
-
} while (0)
|
|
229
|
-
|
|
230
|
-
#endif /* #if HKU_DEBUG_MODE */
|
|
231
|
-
#ifdef HKU_ENABLE_STACK_TRACE
|
|
155
|
+
#if HKU_ENABLE_STACK_TRACE
|
|
232
156
|
/**
|
|
233
157
|
* 若表达式为 false,将抛出 hku::exception 异常
|
|
234
158
|
* @note 仅用于内部入参检查,编译时可通过 HKU_DISABLE_ASSERT 宏关闭
|
|
@@ -253,9 +177,9 @@ std::string HKU_API getLocalTime();
|
|
|
253
177
|
} \
|
|
254
178
|
} while (0)
|
|
255
179
|
|
|
256
|
-
#endif // #
|
|
180
|
+
#endif // #if HKU_ENABLE_STACK_TRACE
|
|
257
181
|
|
|
258
|
-
#
|
|
182
|
+
#if !HKU_ENABLE_STACK_TRACE
|
|
259
183
|
/** 抛出 hku::exception 及传入信息 */
|
|
260
184
|
#define HKU_THROW(...) \
|
|
261
185
|
do { \
|
|
@@ -286,7 +210,7 @@ std::string HKU_API getLocalTime();
|
|
|
286
210
|
throw except( \
|
|
287
211
|
fmt::format("EXCEPTION: {} [{}] ({}:{})", errmsg, HKU_FUNCTION, __FILE__, __LINE__)); \
|
|
288
212
|
} while (0)
|
|
289
|
-
#endif // #
|
|
213
|
+
#endif // #if !HKU_ENABLE_STACK_TRACE
|
|
290
214
|
|
|
291
215
|
/**
|
|
292
216
|
* 满足指定条件时,打印 TRACE 信息
|
|
@@ -420,12 +344,66 @@ std::string HKU_API getLocalTime();
|
|
|
420
344
|
|
|
421
345
|
/** 用于 catch (...) 中打印,减少编译后代码大小 */
|
|
422
346
|
extern std::string g_unknown_error_msg;
|
|
347
|
+
#define HKU_THROW_UNKNOWN HKU_THROW(g_unknown_error_msg);
|
|
423
348
|
#define HKU_TRACE_UNKNOWN HKU_TRACE(g_unknown_error_msg)
|
|
424
349
|
#define HKU_DEBUG_UNKNOWN HKU_DEBUG(g_unknown_error_msg)
|
|
425
350
|
#define HKU_INFO_UNKNOWN HKU_INFO(g_unknown_error_msg)
|
|
426
351
|
#define HKU_ERROR_UNKNOWN HKU_ERROR(g_unknown_error_msg)
|
|
427
352
|
#define HKU_FATAL_UNKNOWN HKU_FATAL(g_unknown_error_msg)
|
|
428
353
|
|
|
354
|
+
#if CPP_STANDARD >= CPP_STANDARD_17
|
|
355
|
+
#define CLASS_LOGGER_IMP(cls) \
|
|
356
|
+
protected: \
|
|
357
|
+
inline static const char* ms_logger = #cls;
|
|
358
|
+
#else
|
|
359
|
+
#define CLASS_LOGGER_IMP(cls) \
|
|
360
|
+
protected: \
|
|
361
|
+
const char* ms_logger = #cls;
|
|
362
|
+
#endif
|
|
363
|
+
|
|
364
|
+
#define CLS_TRACE(...) HKU_TRACE(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
365
|
+
#define CLS_DEBUG(...) HKU_DEBUG(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
366
|
+
#define CLS_INFO(...) HKU_INFO(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
367
|
+
#define CLS_WARN(...) HKU_WARN(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
368
|
+
#define CLS_ERROR(...) HKU_ERROR(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
369
|
+
#define CLS_FATAL(...) HKU_FATAL(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
370
|
+
|
|
371
|
+
#define CLS_TRACE_IF(expr, ...) \
|
|
372
|
+
HKU_TRACE_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
373
|
+
#define CLS_DEBUG_IF(expr, ...) \
|
|
374
|
+
HKU_DEBUG_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
375
|
+
#define CLS_INFO_IF(expr, ...) \
|
|
376
|
+
HKU_INFO_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
377
|
+
#define CLS_WARN_IF(expr, ...) \
|
|
378
|
+
HKU_WARN_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
379
|
+
#define CLS_ERROR_IF(expr, ...) \
|
|
380
|
+
HKU_ERROR_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
381
|
+
#define CLS_FATAL_IF(expr, ...) \
|
|
382
|
+
HKU_FATAL_IF(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
383
|
+
|
|
384
|
+
#define CLS_IF_RETURN(expr, ret) HKU_IF_RETURN(expr, ret)
|
|
385
|
+
#define CLS_TRACE_IF_RETURN(expr, ret, ...) \
|
|
386
|
+
HKU_TRACE_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
387
|
+
#define CLS_DEBUG_IF_RETURN(expr, ret, ...) \
|
|
388
|
+
HKU_DEBUG_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
389
|
+
#define CLS_INFO_IF_RETURN(expr, ret, ...) \
|
|
390
|
+
HKU_INFO_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
391
|
+
#define CLS_WARN_IF_RETURN(expr, ret, ...) \
|
|
392
|
+
HKU_WARN_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
393
|
+
#define CLS_ERROR_IF_RETURN(expr, ret, ...) \
|
|
394
|
+
HKU_ERROR_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
395
|
+
#define CLS_FATAL_IF_RETURN(expr, ret, ...) \
|
|
396
|
+
HKU_FATAL_IF_RETURN(expr, ret, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
397
|
+
|
|
398
|
+
#define CLS_ASSERT HKU_ASSERT
|
|
399
|
+
#define CLS_CHECK(expr, ...) \
|
|
400
|
+
HKU_CHECK(expr, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
401
|
+
#define CLS_CHECK_THROW(expr, except, ...) \
|
|
402
|
+
HKU_CHECK_THROW(expr, except, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
403
|
+
#define CLS_THROW(...) HKU_THROW(fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
404
|
+
#define CLS_THROW_EXCEPTION(except, ...) \
|
|
405
|
+
HKU_THROW_EXCEPTION(except, fmt::format("[{}] {}", ms_logger, fmt::format(__VA_ARGS__)))
|
|
406
|
+
|
|
429
407
|
/** @} */
|
|
430
408
|
|
|
431
409
|
} /* namespace hku */
|