libaudiohal: Modify logging in DeviceHalAidl/Hal2AidlMapper/StreamHalAidl
DeviceHalAidl API can be used for different modules. Modify the logging pattern to include the module names in DeviceHalAidl/Hal2AidlMapper for better information.
Use function name, instance name information embedded in a macro to maintain consistency in the logs.
Similarly, for Stream classes use ioHandle to identify the stream in use.
Test: run CoreAudioHalAidlTest
Bug: 356310696
Change-Id: I4d96408fb984d37f4ac609a9ee3a6adf8411bd89
diff --git a/media/libaudiohal/impl/ConversionHelperAidl.h b/media/libaudiohal/impl/ConversionHelperAidl.h
index 0fadd9c..2d19bee 100644
--- a/media/libaudiohal/impl/ConversionHelperAidl.h
+++ b/media/libaudiohal/impl/ConversionHelperAidl.h
@@ -49,13 +49,15 @@
class ConversionHelperAidl {
protected:
- ConversionHelperAidl(std::string_view className) : mClassName(className) {}
+ ConversionHelperAidl(std::string_view className, std::string_view instanceName)
+ : mClassName(className), mInstanceName(instanceName) {}
- const std::string& getClassName() const {
- return mClassName;
- }
+ const std::string& getClassName() const { return mClassName; }
+
+ const std::string& getInstanceName() const { return mInstanceName; }
const std::string mClassName;
+ const std::string mInstanceName;
};
// 'action' must accept a value of type 'T' and return 'status_t'.