Add log_level option to filter output logs

This commit is contained in:
Tindy X committed 2020-03-05 13:57:58 +08:00
1 parent 15a66609af
commit 908d8ec19d
10 files changed
+244 -79

No files matched your search

+2 -1
View File
@@ -17,6 +17,7 @@
#endif // _WIN32
extern bool print_debug_info;
extern int global_log_level;
typedef std::lock_guard<std::mutex> guarded_mutex;
std::mutex cache_rw_lock;
@@ -47,7 +48,7 @@ static int writer(char *data, size_t size, size_t nmemb, std::string *writerData
static inline void curl_set_common_options(CURL *curl_handle, const char *url)
{
curl_easy_setopt(curl_handle, CURLOPT_URL, url);
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, print_debug_info ? 1L : 0L);
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, global_log_level == LOG_LEVEL_VERBOSE ? 1L : 0L);
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1L);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);