{"id":48,"date":"2024-08-20T10:45:47","date_gmt":"2024-08-20T02:45:47","guid":{"rendered":"https:\/\/cnsn.rr.nu\/?p=48"},"modified":"2024-08-20T10:45:47","modified_gmt":"2024-08-20T02:45:47","slug":"qt%e4%b8%ad%e6%97%a5%e5%bf%97%e7%b3%bb%e7%bb%9f%e9%80%89%e6%8b%a9","status":"publish","type":"post","link":"https:\/\/blog.cnsn.fun\/?p=48","title":{"rendered":"qt\u4e2d\u65e5\u5fd7\u7cfb\u7edf\u9009\u62e9"},"content":{"rendered":"<p>\u5728Qt\u4e2d\u5b9e\u73b0\u4e00\u4e2a\u7b26\u5408\u4f60\u9700\u6c42\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6848\uff0c\u8fd9\u4e9b\u65b9\u6848\u80fd\u591f\u6ee1\u8db3\u683c\u5f0f\u5316\u65e5\u5fd7\u8f93\u51fa\u3001\u65e5\u5fd7\u7b49\u7ea7\u7ba1\u7406\uff0c\u4ee5\u53ca\u5728\u542f\u7528\u8c03\u8bd5\u9009\u9879\u65f6\u5305\u542b\u6587\u4ef6\u3001\u51fd\u6570\u548c\u884c\u6570\u7b49\u4fe1\u606f\u7684\u8981\u6c42\u3002<\/p>\n<h3>1. <strong>Qt \u5185\u7f6e\u65e5\u5fd7\u529f\u80fd (<code>qDebug<\/code>, <code>qWarning<\/code>, <code>qCritical<\/code>, <code>qFatal<\/code>)<\/strong><\/h3>\n<p>Qt \u81ea\u5e26\u4e86\u4e00\u5957\u65e5\u5fd7\u529f\u80fd\uff0c\u4e3b\u8981\u5305\u62ec <code>qDebug<\/code>, <code>qWarning<\/code>, <code>qCritical<\/code>, \u548c <code>qFatal<\/code> \u8fd9\u51e0\u4e2a\u5b8f\u3002\u867d\u7136\u9ed8\u8ba4\u7684\u8f93\u51fa\u683c\u5f0f\u76f8\u5bf9\u7b80\u5355\uff0c\u4f46\u4f60\u53ef\u4ee5\u901a\u8fc7\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u6d41\uff0c\u6765\u81ea\u5b9a\u4e49\u65e5\u5fd7\u683c\u5f0f\u548c\u5185\u5bb9\u3002<\/p>\n<h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<pre><code class=\"language-cpp\">#include &lt;QDebug&gt;\n#include &lt;QDateTime&gt;\n#include &lt;QFile&gt;\n#include &lt;QTextStream&gt;\n\nvoid customLogOutput(QtMsgType type, const QMessageLogContext &amp;context, const QString &amp;msg) {\n    QString logLevel;\n    switch (type) {\n    case QtDebugMsg:\n        logLevel = &quot;DEBUG&quot;;\n        break;\n    case QtWarningMsg:\n        logLevel = &quot;WARNING&quot;;\n        break;\n    case QtCriticalMsg:\n        logLevel = &quot;CRITICAL&quot;;\n        break;\n    case QtFatalMsg:\n        logLevel = &quot;FATAL&quot;;\n        break;\n    }\n\n    QString logMessage = QString(&quot;%1 [%2] (%3:%4, %5): %6&quot;)\n        .arg(QDateTime::currentDateTime().toString(&quot;yyyy-MM-dd hh:mm:ss&quot;))\n        .arg(logLevel)\n        .arg(context.file)\n        .arg(context.line)\n        .arg(context.function)\n        .arg(msg);\n\n    QFile outFile(&quot;app.log&quot;);\n    if (outFile.open(QIODevice::WriteOnly | QIODevice::Append)) {\n        QTextStream ts(&amp;outFile);\n        ts &lt;&lt; logMessage &lt;&lt; endl;\n    }\n\n    \/\/ \u4e5f\u53ef\u4ee5\u5c06\u65e5\u5fd7\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u6216\u5176\u4ed6\u5730\u65b9\n    QTextStream(stdout) &lt;&lt; logMessage &lt;&lt; endl;\n}\n\nint main(int argc, char *argv[]) {\n    QCoreApplication a(argc, argv);\n\n    qInstallMessageHandler(customLogOutput);\n\n    qDebug() &lt;&lt; &quot;This is a debug message&quot;;\n    qWarning() &lt;&lt; &quot;This is a warning message&quot;;\n    qCritical() &lt;&lt; &quot;This is a critical message&quot;;\n    \/\/ qFatal() &lt;&lt; &quot;This is a fatal error message&quot;;\n\n    return a.exec();\n}<\/code><\/pre>\n<h4>\u89e3\u91ca\uff1a<\/h4>\n<ul>\n<li><strong>\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa<\/strong>\uff1a\u901a\u8fc7 <code>qInstallMessageHandler<\/code> \u53ef\u4ee5\u91cd\u5b9a\u5411 Qt \u65e5\u5fd7\u8f93\u51fa\uff0c\u5c06\u65e5\u5fd7\u4fe1\u606f\u91cd\u5b9a\u5411\u5230\u81ea\u5b9a\u4e49\u7684\u5904\u7406\u51fd\u6570 <code>customLogOutput<\/code>\u3002<\/li>\n<li><strong>\u683c\u5f0f\u5316\u65e5\u5fd7<\/strong>\uff1a\u5728\u81ea\u5b9a\u4e49\u7684\u5904\u7406\u51fd\u6570\u4e2d\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u683c\u5f0f\u5316\u65e5\u5fd7\u5185\u5bb9\uff0c\u5305\u542b\u65f6\u95f4\u3001\u65e5\u5fd7\u7b49\u7ea7\u3001\u6587\u4ef6\u3001\u884c\u6570\u3001\u51fd\u6570\u7b49\u4fe1\u606f\u3002<\/li>\n<li><strong>\u65e5\u5fd7\u8f93\u51fa<\/strong>\uff1a\u53ef\u4ee5\u5c06\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6\u3001\u63a7\u5236\u53f0\u6216\u5176\u4ed6\u76ee\u6807\uff0c\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h4>\u4f18\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u8f7b\u91cf\u7ea7<\/strong>\uff1a\u4f7f\u7528 Qt \u81ea\u5e26\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u65e0\u9700\u5f15\u5165\u989d\u5916\u7684\u5e93\u6216\u6a21\u5757\u3002<\/li>\n<li><strong>\u6613\u4e8e\u6269\u5c55<\/strong>\uff1a\u901a\u8fc7\u81ea\u5b9a\u4e49\u65e5\u5fd7\u5904\u7406\u51fd\u6570\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u63a7\u5236\u65e5\u5fd7\u8f93\u51fa\u683c\u5f0f\u548c\u5185\u5bb9\u3002<\/li>\n<li><strong>\u53ef\u63a7<\/strong>\uff1a\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u5728\u8fd0\u884c\u65f6\u542f\u7528\u6216\u7981\u7528\u4e0d\u540c\u7ea7\u522b\u7684\u65e5\u5fd7\u8f93\u51fa\u3002<\/li>\n<\/ul>\n<h4>\u7f3a\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u529f\u80fd\u8f83\u57fa\u7840<\/strong>\uff1a\u9700\u8981\u81ea\u5df1\u5b9e\u73b0\u66f4\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u65e5\u5fd7\u8f6e\u8f6c\u3001\u5f02\u6b65\u5199\u5165\u7b49\u3002<\/li>\n<\/ul>\n<h3>2. <strong>\u57fa\u4e8e <code>QLoggingCategory<\/code> \u7684\u65e5\u5fd7\u7cfb\u7edf<\/strong><\/h3>\n<p><code>QLoggingCategory<\/code> \u662f Qt 5 \u5f15\u5165\u7684\u4e00\u4e2a\u66f4\u9ad8\u7ea7\u7684\u65e5\u5fd7\u5206\u7c7b\u548c\u7ba1\u7406\u5de5\u5177\u3002\u5b83\u5141\u8bb8\u4f60\u5bf9\u65e5\u5fd7\u8fdb\u884c\u5206\u7c7b\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u63a7\u5236\u54ea\u4e9b\u7c7b\u522b\u7684\u65e5\u5fd7\u542f\u7528\u6216\u7981\u7528\u3002<\/p>\n<h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<pre><code class=\"language-cpp\">#include &lt;QLoggingCategory&gt;\n\nQ_LOGGING_CATEGORY(logDebug, &quot;myApp.debug&quot;)\nQ_LOGGING_CATEGORY(logWarning, &quot;myApp.warning&quot;)\n\nvoid logExample() {\n    qCDebug(logDebug) &lt;&lt; &quot;This is a debug message&quot;;\n    qCWarning(logWarning) &lt;&lt; &quot;This is a warning message&quot;;\n}<\/code><\/pre>\n<h4>\u89e3\u91ca\uff1a<\/h4>\n<ul>\n<li><strong>\u65e5\u5fd7\u5206\u7c7b<\/strong>\uff1a\u901a\u8fc7 <code>QLoggingCategory<\/code> \u521b\u5efa\u4e0d\u540c\u7684\u65e5\u5fd7\u5206\u7c7b\uff0c\u5e76\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528 <code>qCDebug<\/code>, <code>qCWarning<\/code> \u7b49\u5b8f\u6765\u8f93\u51fa\u65e5\u5fd7\u3002<\/li>\n<li><strong>\u63a7\u5236\u65e5\u5fd7\u7ea7\u522b<\/strong>\uff1a\u4f60\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4e2d\u6216\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u52a8\u6001\u542f\u7528\u6216\u7981\u7528\u7279\u5b9a\u5206\u7c7b\u7684\u65e5\u5fd7\u8f93\u51fa\uff0c\u7075\u6d3b\u63a7\u5236\u65e5\u5fd7\u7ea7\u522b\u3002<\/li>\n<\/ul>\n<h4>\u4f18\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u5206\u7c7b\u7ba1\u7406<\/strong>\uff1a\u53ef\u4ee5\u6839\u636e\u4e0d\u540c\u7684\u6a21\u5757\u6216\u529f\u80fd\u5b9a\u4e49\u65e5\u5fd7\u5206\u7c7b\uff0c\u589e\u5f3a\u65e5\u5fd7\u7684\u53ef\u7ba1\u7406\u6027\u3002<\/li>\n<li><strong>\u8fd0\u884c\u65f6\u63a7\u5236<\/strong>\uff1a\u53ef\u4ee5\u5728\u4e0d\u4fee\u6539\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u52a8\u6001\u63a7\u5236\u65e5\u5fd7\u8f93\u51fa\u3002<\/li>\n<\/ul>\n<h4>\u7f3a\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u590d\u6742\u5ea6\u7565\u9ad8<\/strong>\uff1a\u76f8\u6bd4\u57fa\u7840\u7684 <code>qDebug<\/code> \u7cfb\u5217\u5b8f\uff0c<code>QLoggingCategory<\/code> \u7684\u4f7f\u7528\u7a0d\u663e\u590d\u6742\uff0c\u9700\u8981\u5b9a\u4e49\u548c\u7ba1\u7406\u591a\u4e2a\u5206\u7c7b\u3002<\/li>\n<\/ul>\n<h3>3. <strong>\u4f7f\u7528\u7b2c\u4e09\u65b9\u65e5\u5fd7\u5e93\uff1a<code>spdlog<\/code><\/strong><\/h3>\n<p>\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2a\u529f\u80fd\u66f4\u5f3a\u5927\u3001\u6027\u80fd\u66f4\u9ad8\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u7b2c\u4e09\u65b9\u65e5\u5fd7\u5e93\u5982 <code>spdlog<\/code> \u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\u3002<code>spdlog<\/code> \u652f\u6301\u5f02\u6b65\u65e5\u5fd7\u8bb0\u5f55\u3001\u9ad8\u6027\u80fd\u3001\u65e5\u5fd7\u8f6e\u8f6c\u3001\u591a\u79cd\u8f93\u51fa\u76ee\u6807\u7b49\u7279\u6027\u3002<\/p>\n<h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<pre><code class=\"language-cpp\">#include &quot;spdlog\/spdlog.h&quot;\n#include &quot;spdlog\/sinks\/basic_file_sink.h&quot;\n\nvoid setupLogger() {\n    auto logger = spdlog::basic_logger_mt(&quot;file_logger&quot;, &quot;logs\/app.log&quot;);\n    spdlog::set_default_logger(logger);\n    spdlog::set_pattern(&quot;%Y-%m-%d %H:%M:%S [%l] %v (%@)&quot;);\n\n    spdlog::info(&quot;Logger initialized&quot;);\n}\n\nint main() {\n    setupLogger();\n\n    spdlog::debug(&quot;This is a debug message&quot;);\n    spdlog::warn(&quot;This is a warning message&quot;);\n    spdlog::error(&quot;This is an error message&quot;);\n\n    return 0;\n}<\/code><\/pre>\n<h4>\u89e3\u91ca\uff1a<\/h4>\n<ul>\n<li><strong>\u65e5\u5fd7\u683c\u5f0f<\/strong>\uff1a\u901a\u8fc7 <code>set_pattern<\/code> \u53ef\u4ee5\u5b9a\u4e49\u65e5\u5fd7\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u5305\u62ec\u65f6\u95f4\u3001\u65e5\u5fd7\u7ea7\u522b\u3001\u6587\u4ef6\u3001\u884c\u6570\u7b49\u3002<\/li>\n<li><strong>\u65e5\u5fd7\u7b49\u7ea7<\/strong>\uff1a<code>spdlog<\/code> \u652f\u6301\u591a\u79cd\u65e5\u5fd7\u7b49\u7ea7\uff08\u5982 <code>debug<\/code>, <code>info<\/code>, <code>warn<\/code>, <code>error<\/code>\uff09\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u7075\u6d3b\u63a7\u5236\u65e5\u5fd7\u8f93\u51fa\u7ea7\u522b\u3002<\/li>\n<li><strong>\u5f02\u6b65\u65e5\u5fd7<\/strong>\uff1a\u5bf9\u4e8e\u6027\u80fd\u654f\u611f\u7684\u5e94\u7528\uff0c<code>spdlog<\/code> \u63d0\u4f9b\u4e86\u5f02\u6b65\u65e5\u5fd7\u6a21\u5f0f\uff0c\u53ef\u4ee5\u5728\u4e0d\u5f71\u54cd\u4e3b\u7ebf\u7a0b\u7684\u60c5\u51b5\u4e0b\u9ad8\u6548\u5730\u8bb0\u5f55\u65e5\u5fd7\u3002<\/li>\n<\/ul>\n<h4>\u4f18\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u9ad8\u6027\u80fd<\/strong>\uff1a<code>spdlog<\/code> \u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\u65e5\u5fd7\u5e93\uff0c\u9002\u5408\u9700\u8981\u9ad8\u6548\u5904\u7406\u65e5\u5fd7\u7684\u5927\u578b\u5e94\u7528\u3002<\/li>\n<li><strong>\u4e30\u5bcc\u529f\u80fd<\/strong>\uff1a\u652f\u6301\u65e5\u5fd7\u8f6e\u8f6c\u3001\u5f02\u6b65\u65e5\u5fd7\u3001\u591a\u7ebf\u7a0b\u5b89\u5168\u7b49\u529f\u80fd\uff0c\u6269\u5c55\u6027\u5f3a\u3002<\/li>\n<\/ul>\n<h4>\u7f3a\u70b9\uff1a<\/h4>\n<ul>\n<li><strong>\u5916\u90e8\u4f9d\u8d56<\/strong>\uff1a\u9700\u8981\u5f15\u5165\u7b2c\u4e09\u65b9\u5e93\uff0c\u589e\u52a0\u4e86\u9879\u76ee\u7684\u590d\u6742\u5ea6\u3002<\/li>\n<li><strong>\u914d\u7f6e\u7a0d\u590d\u6742<\/strong>\uff1a\u76f8\u5bf9\u4e8e Qt \u5185\u7f6e\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c<code>spdlog<\/code> \u9700\u8981\u66f4\u591a\u7684\u914d\u7f6e\u548c\u5b66\u4e60\u6210\u672c\u3002<\/li>\n<\/ul>\n<h3><strong>\u63a8\u8350\u65b9\u6848<\/strong><\/h3>\n<p>\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u4e14\u6613\u4e8e\u96c6\u6210\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u5e76\u4e14\u5e0c\u671b\u5229\u7528Qt\u73b0\u6709\u7684\u529f\u80fd\uff0c\u5efa\u8bae\u4f7f\u7528 <strong>Qt \u5185\u7f6e\u65e5\u5fd7\u529f\u80fd<\/strong>\uff08<code>qDebug<\/code>\u7b49\uff09\uff0c\u7ed3\u5408 <strong>\u81ea\u5b9a\u4e49\u65e5\u5fd7\u5904\u7406\u51fd\u6570<\/strong> \u6765\u5b9e\u73b0\u683c\u5f0f\u5316\u8f93\u51fa\u548c\u65e5\u5fd7\u7ba1\u7406\u3002<\/p>\n<ul>\n<li><strong>\u4f7f\u7528 Qt \u5185\u7f6e\u65e5\u5fd7\u529f\u80fd<\/strong>\uff1a\u53ef\u4ee5\u6ee1\u8db3\u4f60\u5bf9\u683c\u5f0f\u5316\u8f93\u51fa\u3001\u65e5\u5fd7\u7b49\u7ea7\u63a7\u5236\u7684\u8981\u6c42\uff0c\u5e76\u4e14\u5bb9\u6613\u96c6\u6210\u5230\u73b0\u6709\u9879\u76ee\u4e2d\u3002<\/li>\n<li><strong>\u81ea\u5b9a\u4e49\u8f93\u51fa\u683c\u5f0f<\/strong>\uff1a\u901a\u8fc7 <code>qInstallMessageHandler<\/code> \u81ea\u5b9a\u4e49\u8f93\u51fa\u683c\u5f0f\uff0c\u5305\u542b\u65f6\u95f4\u3001\u65e5\u5fd7\u7b49\u7ea7\u3001\u6587\u4ef6\u3001\u51fd\u6570\u3001\u884c\u6570\u7b49\u4fe1\u606f\u3002<\/li>\n<li><strong>\u8fd0\u884c\u65f6\u63a7\u5236\u65e5\u5fd7\u7ea7\u522b<\/strong>\uff1a\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u6216\u901a\u8fc7\u7f16\u8bd1\u9009\u9879\uff08\u5982<code>#define QT_NO_DEBUG_OUTPUT<\/code>\uff09\u63a7\u5236\u65e5\u5fd7\u8f93\u51fa\u7684\u7ea7\u522b\uff0c\u9002\u5408\u5728\u4e0d\u540c\u73af\u5883\u4e2d\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u6709\u66f4\u9ad8\u7684\u6027\u80fd\u9700\u6c42\u6216\u590d\u6742\u7684\u65e5\u5fd7\u7ba1\u7406\u9700\u6c42\uff0c\u4e14\u4e0d\u4ecb\u610f\u5f15\u5165\u7b2c\u4e09\u65b9\u5e93\uff0c<strong><code>spdlog<\/code><\/strong> \u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u9009\u62e9\uff0c\u53ef\u4ee5\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u65e5\u5fd7\u529f\u80fd\u3002<\/p>\n<h3><strong>\u603b\u7ed3<\/strong><\/h3>\n<p>\u5bf9\u4e8e\u5927\u591a\u6570Qt\u5e94\u7528\uff0c\u4f7f\u7528Qt\u5185\u7f6e\u7684\u65e5\u5fd7\u529f\u80fd\u914d\u5408\u81ea\u5b9a\u4e49\u683c\u5f0f\u8f93\u51fa\uff0c\u5df2\u7ecf\u80fd\u591f\u6ee1\u8db3\u5e38\u89c1\u7684\u65e5\u5fd7\u9700\u6c42\u3002\u5982\u679c\u9700\u8981\u989d\u5916\u7684\u529f\u80fd\uff0c\u5982\u65e5\u5fd7\u8f6e\u8f6c\u3001\u5f02\u6b65\u5904\u7406\uff0c\u5219\u53ef\u4ee5\u8003\u8651\u5f15\u5165<code>spdlog<\/code>\u7b49\u7b2c\u4e09\u65b9\u5e93\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Qt\u4e2d\u5b9e\u73b0\u4e00\u4e2a\u7b26\u5408\u4f60\u9700\u6c42\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6848\uff0c\u8fd9\u4e9b\u65b9\u6848\u80fd\u591f\u6ee1\u8db3\u683c\u5f0f\u5316\u65e5\u5fd7\u8f93\u51fa\u3001\u65e5\u5fd7\u7b49\u7ea7\u7ba1\u7406\uff0c\u4ee5\u53ca [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[22,33],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-qt","tag-qt","tag-33"],"_links":{"self":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48"}],"version-history":[{"count":0,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}