{"id":7051,"date":"2022-09-26T19:24:37","date_gmt":"2022-09-26T11:24:37","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress_it\/?p=7051"},"modified":"2023-08-11T20:10:19","modified_gmt":"2023-08-11T12:10:19","slug":"glog%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=7051","title":{"rendered":"glog\u4ea4\u53c9\u7f16\u8bd1"},"content":{"rendered":"<p>github\u4e0b\u8f7d\u4e0d\u4e86glog\u53ef\u4ee5\u4e0agitcode\u6216\u8005gitee<br \/>\n<a href=\"https:\/\/blog.csdn.net\/hhaijiuwo\/article\/details\/119876307\">https:\/\/blog.csdn.net\/hhaijiuwo\/article\/details\/119876307<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/console_log\/article\/details\/122839173?spm=1001.2101.3001.6650.5&amp;utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7ERate-5-122839173-blog-120749148.pc_relevant_multi_platform_featuressortv2dupreplace&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7ERate-5-122839173-blog-120749148.pc_relevant_multi_platform_featuressortv2dupreplace&amp;utm_relevant_index=6\">https:\/\/blog.csdn.net\/console_log\/article\/details\/122839173?spm=1001.2101.3001.6650.5&amp;utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7ERate-5-122839173-blog-120749148.pc_relevant_multi_platform_featuressortv2dupreplace&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7ERate-5-122839173-blog-120749148.pc_relevant_multi_platform_featuressortv2dupreplace&amp;utm_relevant_index=6<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/feitingfj\/article\/details\/120749148?spm=1001.2101.3001.6650.16&amp;utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EESQUERY%7ERate-16-120749148-blog-119876307.pc_relevant_multi_platform_whitelistv6&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EESQUERY%7ERate-16-120749148-blog-119876307.pc_relevant_multi_platform_whitelistv6&amp;utm_relevant_index=19\">https:\/\/blog.csdn.net\/feitingfj\/article\/details\/120749148?spm=1001.2101.3001.6650.16&amp;utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EESQUERY%7ERate-16-120749148-blog-119876307.pc_relevant_multi_platform_whitelistv6&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EESQUERY%7ERate-16-120749148-blog-119876307.pc_relevant_multi_platform_whitelistv6&amp;utm_relevant_index=19<\/a><\/p>\n<ul>\n<li>\n<p>Could not find a package configuration file... GflagsConfig.cmake gflags-config.cmake \u89e3\u51b3\u65b9\u6cd5<br \/>\n<a href=\"https:\/\/blog.csdn.net\/qq_39779233\/article\/details\/123970672\">https:\/\/blog.csdn.net\/qq_39779233\/article\/details\/123970672<\/a><\/p>\n<\/li>\n<li>\n<p>Could not find a package configuration file... GflagsConfig.cmake gflags-config.cmake<br \/>\n<a href=\"https:\/\/blog.csdn.net\/qq_39779233\/article\/details\/125400866\">https:\/\/blog.csdn.net\/qq_39779233\/article\/details\/125400866<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>NDK\u4ea4\u53c9\u7f16\u8bd1glog<\/h3>\n<ul>\n<li>CMakeLists.txt\u4fee\u6539<\/li>\n<\/ul>\n<p>1.\u6ce8\u91ca<code>set (CMAKE_DEBUG_POSTFIX d)<\/code><br \/>\n2.\u6ce8\u91ca<code>logging_unittest.cc<\/code>\u76f8\u5173\u7684\u7f16\u8bd1\uff0c\u5426\u5219\u62a5\u9519<\/p>\n<pre><code class=\"language-bash\">\n#  add_executable (logging_unittest\n#    src\/logging_unittest.cc\n#  )\n\n#  target_link_libraries (logging_unittest PRIVATE ${_GLOG_TEST_LIBS})\n\n#  add_test (NAME logging COMMAND logging_unittest)\n\n#  set_tests_properties (logging PROPERTIES TIMEOUT 30)\n#  # MacOS diff is not deterministic: use the output to determine whether the\n#  # test passed.\n#  set_tests_properties (logging PROPERTIES PASS_REGULAR_EXPRESSION &quot;.*\\nPASS\\n.*&quot;)\n#\n#  # FIXME: Skip flaky test\n#  set_tests_properties (logging PROPERTIES SKIP_REGULAR_EXPRESSION\n#    &quot;Check failed: time_ns within LogTimes::LOG_PERIOD_TOL_NS of LogTimes::LOG_PERIOD_NS&quot;)\n#\n#  if (APPLE)\n#    # FIXME: Skip flaky test\n#    set_property (TEST logging APPEND PROPERTY SKIP_REGULAR_EXPRESSION\n#      &quot;unexpected new.*PASS\\nTest with golden file failed. We&#039;ll try to show the diff:&quot;)\n#  endif (APPLE)<\/code><\/pre>\n<ul>\n<li>\u5229\u7528NDK\u5236\u4f5c\u7f16\u8bd1\u811a\u672c<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">mkdir -p build\n\ncd build\n\nrm -rf *\n\nexport CMAKE_BUILD_TYPE=Debug\n\ncmake .. \\\n-DCMAKE_TOOLCHAIN_FILE=\/etc\/opt\/pkg\/android-ndk-r25c\/build\/cmake\/android.toolchain.cmake \\\n-DANDROID_ABI=&quot;arm64-v8a&quot; \\\n-DANDROID_NATIVE_API_LEVEL=android-24 \\\n\nmake -j4<\/code><\/pre>\n<ul>\n<li>\u5f15\u7528libglog\u7684\u9879\u76ee\u8981\u5f15\u7528andorid\u7684log\u5e93<br \/>\n<code>target_link_libraries(lxc_socket_server log)<\/code><\/li>\n<\/ul>\n<p>\u5426\u5219\u62a5\u9519\uff1a\uff08\u6ce8\u610f\u5230glog\u91cc\u4e5f\u6709\u5f15\u7528\uff0c\u4f46\u662f\u6ca1\u6709\u7528\u3002\uff09<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2022\/09\/android_log_error.png\" alt=\"\" \/><\/p>\n<p>\u4f46\u662f\u5982\u679c\u6253<strong>\u9759\u6001\u94fe\u63a5\u53ef\u6267\u884c\u6587\u4ef6<\/strong>\u5305\uff0cCMakeLists.txt\u91cc\u8bbe\u7f6e<code>SET(CMAKE_EXE_LINKER_FLAGS &quot;-static&quot;)<\/code>\u4e4b\u540e\u7f16\u8bd1\u53c8\u4f1a\u62a5\u9519\uff1a<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2022\/09\/android_log_error2.png\" alt=\"\" \/><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"7051\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>github\u4e0b\u8f7d\u4e0d\u4e86glog\u53ef\u4ee5\u4e0agitcode\u6216\u8005gitee https:\/\/blog.csdn. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[711],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/7051"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7051"}],"version-history":[{"count":4,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/7051\/revisions"}],"predecessor-version":[{"id":10221,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/7051\/revisions\/10221"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7051"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}