<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic why I can't receive cpp log in android? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/why-I-can-t-receive-cpp-log-in-android/m-p/1495960#M193070</link>
    <description>&lt;P&gt;my os is imx-automotive-10.0.0_2.2.0$, mx8q, now I want to print some log in cpp file like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;diff --git a/frameworks/av/media/audioserver/main_audioserver.cpp b/frameworks/av/media/audioserver/main_audioserver.cpp
index db5724804a..6ed284e0b4 100644
--- a/frameworks/av/media/audioserver/main_audioserver.cpp
+++ b/frameworks/av/media/audioserver/main_audioserver.cpp
@@ -13,8 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-#define LOG_TAG "audioserver"

+#include &amp;lt;android/log.h&amp;gt;
+#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,## __VA_ARGS__)
+#define ALOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG, ## __VA_ARGS__)
+#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG, ## __VA_ARGS__)
+#define LOG_TAG "liwenxiu_audioservice"
 //#define LOG_NDEBUG 0

 #include &amp;lt;fcntl.h&amp;gt;
@@ -136,7 +140,10 @@ int main(int argc __unused, char **argv)
         sp&amp;lt;ProcessState&amp;gt; proc(ProcessState::self());
         sp&amp;lt;IServiceManager&amp;gt; sm = defaultServiceManager();
         ALOGI("ServiceManager: %p", sm.get());
-        AudioFlinger::instantiate();
+  
+         // char * log =(char*) "liwx_tag";
+      ALOGI("------------AudioFlinger::instantiate()----------liwenxiu");
+       AudioFlinger::instantiate();
         AudioPolicyService::instantiate();

         // AAudioService should only be used in OC-MR1 and later.&lt;/LI-CODE&gt;&lt;P&gt;but I get nothing when I using dmesg and logcat to print, someone can tell me why, if must make some .so files ?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 03:04:33 GMT</pubDate>
    <dc:creator>yhm2046</dc:creator>
    <dc:date>2022-07-27T03:04:33Z</dc:date>
    <item>
      <title>why I can't receive cpp log in android?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/why-I-can-t-receive-cpp-log-in-android/m-p/1495960#M193070</link>
      <description>&lt;P&gt;my os is imx-automotive-10.0.0_2.2.0$, mx8q, now I want to print some log in cpp file like this:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;diff --git a/frameworks/av/media/audioserver/main_audioserver.cpp b/frameworks/av/media/audioserver/main_audioserver.cpp
index db5724804a..6ed284e0b4 100644
--- a/frameworks/av/media/audioserver/main_audioserver.cpp
+++ b/frameworks/av/media/audioserver/main_audioserver.cpp
@@ -13,8 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-#define LOG_TAG "audioserver"

+#include &amp;lt;android/log.h&amp;gt;
+#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,## __VA_ARGS__)
+#define ALOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG, ## __VA_ARGS__)
+#define ALOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG, ## __VA_ARGS__)
+#define LOG_TAG "liwenxiu_audioservice"
 //#define LOG_NDEBUG 0

 #include &amp;lt;fcntl.h&amp;gt;
@@ -136,7 +140,10 @@ int main(int argc __unused, char **argv)
         sp&amp;lt;ProcessState&amp;gt; proc(ProcessState::self());
         sp&amp;lt;IServiceManager&amp;gt; sm = defaultServiceManager();
         ALOGI("ServiceManager: %p", sm.get());
-        AudioFlinger::instantiate();
+  
+         // char * log =(char*) "liwx_tag";
+      ALOGI("------------AudioFlinger::instantiate()----------liwenxiu");
+       AudioFlinger::instantiate();
         AudioPolicyService::instantiate();

         // AAudioService should only be used in OC-MR1 and later.&lt;/LI-CODE&gt;&lt;P&gt;but I get nothing when I using dmesg and logcat to print, someone can tell me why, if must make some .so files ?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 03:04:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/why-I-can-t-receive-cpp-log-in-android/m-p/1495960#M193070</guid>
      <dc:creator>yhm2046</dc:creator>
      <dc:date>2022-07-27T03:04:33Z</dc:date>
    </item>
  </channel>
</rss>

