diff options
author | Saturneric <[email protected]> | 2022-05-20 18:10:54 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-05-20 18:10:54 +0000 |
commit | e4e8e0308cf109fd317a1f3f79b78dda413ada13 (patch) | |
tree | 17e2d37ee8048789f329a26277a671d77d353fe9 | |
parent | feat: track pending tasks in task runner system (diff) | |
download | GpgFrontend-e4e8e0308cf109fd317a1f3f79b78dda413ada13.tar.gz GpgFrontend-e4e8e0308cf109fd317a1f3f79b78dda413ada13.zip |
fix: remove useless log in Channel system
-rw-r--r-- | src/core/GpgFunctionObject.cpp | 18 | ||||
-rw-r--r-- | src/core/GpgFunctionObject.h | 7 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/core/GpgFunctionObject.cpp b/src/core/GpgFunctionObject.cpp index 84a3f5b7..1289d72f 100644 --- a/src/core/GpgFunctionObject.cpp +++ b/src/core/GpgFunctionObject.cpp @@ -51,19 +51,16 @@ void GpgFrontend::SingletonStorage::ReleaseChannel(int channel) { _it = instances_map_.find(channel); } if (_it != instances_map_.end()) instances_map_.erase(_it); - DLOG(TRACE) << "channel" << channel << "released"; } GpgFrontend::ChannelObject* GpgFrontend::SingletonStorage::FindObjectInChannel( int channel) { - LOG(TRACE) << "channel:" << channel << "instance address:" << &instances_map_; // read instances_map_ decltype(instances_map_.end()) _it; { std::shared_lock<std::shared_mutex> lock(instances_mutex_); _it = instances_map_.find(channel); if (_it == instances_map_.end()) { - LOG(TRACE) << "channel:" << channel << "not found"; return nullptr; } else { return _it->second.get(); @@ -82,7 +79,7 @@ std::vector<int> GpgFrontend::SingletonStorage::GetAllChannelId() { GpgFrontend::ChannelObject* GpgFrontend::SingletonStorage::SetObjectInChannel( int channel, std::unique_ptr<ChannelObject> p_obj) { { - LOG(TRACE) << "channel:" << channel + LOG(TRACE) << "set channel:" << channel << "instance address:" << &instances_map_; assert(p_obj != nullptr); @@ -102,7 +99,6 @@ GpgFrontend::SingletonStorage* GpgFrontend::SingletonStorageCollection::GetSingletonStorage( const std::type_info& type_id) { const auto hash = type_id.hash_code(); - LOG(TRACE) << "hash" << hash << "type_name:" << type_id.name(); while (true) { decltype(storages_map_.end()) _it; @@ -111,16 +107,15 @@ GpgFrontend::SingletonStorageCollection::GetSingletonStorage( _it = storages_map_.find(hash); } if (_it == storages_map_.end()) { - LOG(TRACE) << "hash:" << hash << "not found"; { std::unique_lock<std::shared_mutex> lock(storages_mutex_); storages_map_.insert({hash, std::make_unique<SingletonStorage>()}); - LOG(TRACE) << "hash:" << hash << "created" - << "storage address:" << &storages_map_; } + LOG(TRACE) << "hash:" << hash << "created" + << "storage address:" << &storages_map_ + << "type_name : " << type_id.name(); continue; } else { - LOG(TRACE) << "hash:" << hash << "found"; return _it->second.get(); } } @@ -137,7 +132,4 @@ GpgFrontend::SingletonStorageCollection::GetInstance() { GpgFrontend::ChannelObject::ChannelObject() noexcept = default; -GpgFrontend::ChannelObject::ChannelObject(int channel) : channel_(channel) { - LOG(TRACE) << "called" - << "channel:" << channel; -} +GpgFrontend::ChannelObject::ChannelObject(int channel) : channel_(channel) {} diff --git a/src/core/GpgFunctionObject.h b/src/core/GpgFunctionObject.h index 7d82ec89..de27ea42 100644 --- a/src/core/GpgFunctionObject.h +++ b/src/core/GpgFunctionObject.h @@ -180,10 +180,8 @@ class SingletonFunctionObject : public ChannelObject { if (_p_pbj == nullptr) { auto new_obj = std::unique_ptr<ChannelObject>(new T(channel)); - LOG(TRACE) << "create new object" << new_obj.get(); return *(T*)(p_storage->SetObjectInChannel(channel, std::move(new_obj))); } else { - LOG(TRACE) << "saved object address" << _p_pbj; return *_p_pbj; } } @@ -281,10 +279,7 @@ class SingletonFunctionObject : public ChannelObject { * * @param channel */ - explicit SingletonFunctionObject(int channel) : ChannelObject(channel) { - LOG(TRACE) << "called" - << "channel:" << channel; - } + explicit SingletonFunctionObject(int channel) : ChannelObject(channel) {} /** * @brief Destroy the Singleton Function Object object |