[Other] Enable to hidden INFO/WARNING log informations (#1368)

* Enable to hidden INFO/WARNING log informations

* Fix build error

---------

Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com>
This commit is contained in:
Jason
2023-02-20 17:24:12 +08:00
committed by GitHub
parent b6658b8094
commit dc5b4be7a9
5 changed files with 36 additions and 5 deletions

View File

@@ -13,18 +13,27 @@
// limitations under the License.
#include "fastdeploy/utils/utils.h"
#include <sstream>
namespace fastdeploy {
bool FDLogger::enable_info = true;
bool FDLogger::enable_warning = true;
void SetLogger(bool enable_info, bool enable_warning) {
FDLogger::enable_info = enable_info;
FDLogger::enable_warning = enable_warning;
}
FDLogger::FDLogger(bool verbose, const std::string& prefix) {
verbose_ = verbose;
line_ = "";
#ifdef __ANDROID__
#ifdef __ANDROID__
prefix_ = std::string("[FastDeploy]") + prefix;
#else
prefix_ = prefix;
#endif
#endif
}
FDLogger& FDLogger::operator<<(std::ostream& (*os)(std::ostream&)) {