Remove BUILD_ENV_LOGGER cmake option and always honor AZURE_LOG_LEVEL env var, if set. (#1827)

This commit is contained in:
Ahson Khan 2021-03-09 23:05:00 -08:00 committed by GitHub
parent a4110e44e2
commit 2213991d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 13 deletions

View File

@ -19,7 +19,6 @@ option(RUN_LONG_UNIT_TESTS "Tests that takes more than 5 minutes to complete. No
option(BUILD_STORAGE_SAMPLES "Build sample application for Azure Storage clients" OFF)
option(BUILD_PERFORMANCE_TESTS "Build the performance test library" OFF)
option(MSVC_USE_STATIC_CRT "(MSVC only) Set to ON to link SDK with static CRT (/MT or /MTd switch)." OFF)
option(BUILD_ENV_LOGGER "Build support for enabling logging to console when AZURE_LOG_LEVEL environment variable is set." ON)
include(AzureTransportAdapters)
include(AzureVcpkg)

View File

@ -21,10 +21,6 @@ az_vcpkg_integrate()
find_package(Threads REQUIRED)
if (NOT BUILD_ENV_LOGGER)
add_compile_definitions(AZ_NO_ENV_LOGGER)
endif()
if(BUILD_TRANSPORT_CURL)
# min version for `CURLSSLOPT_NO_REVOKE`
# https://curl.haxx.se/libcurl/c/CURLOPT_SSL_OPTIONS.html

View File

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#if defined(AZ_NO_ENV_LOGGER)
#include "azure/core/platform.hpp"
#if defined(AZ_PLATFORM_WINDOWS)
@ -14,11 +13,9 @@
#include <windows.h>
#endif
#endif
#if !defined(AZ_NO_ENV_LOGGER) \
&& (!defined(WINAPI_PARTITION_DESKTOP) \
|| WINAPI_PARTITION_DESKTOP) // See azure/core/platform.hpp for explanation.
#if (!defined(WINAPI_PARTITION_DESKTOP) || WINAPI_PARTITION_DESKTOP) // See azure/core/platform.hpp
// for explanation.
#include "environment_log_level_listener_private.hpp"

View File

@ -27,9 +27,8 @@ namespace Azure { namespace Core { namespace _detail {
static Logger::Listener GetLogListener();
};
#if defined(AZ_NO_ENV_LOGGER) \
|| (defined(WINAPI_PARTITION_DESKTOP) \
&& !WINAPI_PARTITION_DESKTOP) // See azure/core/platform.hpp for explanation.
#if (defined(WINAPI_PARTITION_DESKTOP) && !WINAPI_PARTITION_DESKTOP) // See azure/core/platform.hpp
// for explanation.
inline Logger::Level EnvironmentLogLevelListener::GetLogLevel(Logger::Level defaultValue)
{
return defaultValue;