1 // Copyright 2021 The Pigweed Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 // use this file except in compliance with the License. You may obtain a copy of 5 // the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 // License for the specific language governing permissions and limitations under 13 // the License. 14 #pragma once 15 16 // These configuration options differ from the options in pw_log/options.h in 17 // that these should be set at a global level in the build system rather than 18 // at a module or compile unit level. 19 20 // PW_LOG_LEVEL_DEFAULT controls the default value of PW_LOG_LEVEL. 21 // 22 // Defaults to PW_LOG_LEVEL_DEBUG. 23 #ifndef PW_LOG_LEVEL_DEFAULT 24 #define PW_LOG_LEVEL_DEFAULT PW_LOG_LEVEL_DEBUG 25 #endif // PW_LOG_LEVEL_DEFAULT 26 27 // PW_LOG_FLAGS_DEFAULT controls the default value of PW_LOG_FLAGS. 28 // 29 // For log statements like LOG_INFO that don't have an explicit argument, this 30 // is used for the flags value. 31 #ifndef PW_LOG_FLAGS_DEFAULT 32 #define PW_LOG_FLAGS_DEFAULT 0 33 #endif // PW_LOG_FLAGS_DEFAULT 34 35 // PW_LOG_ENABLE_IF_DEFAULT controls the default value of PW_LOG_ENABLE_IF. 36 // 37 // This expression determines whether or not the statement is enabled and 38 // should be passed to the backend. 39 #ifndef PW_LOG_ENABLE_IF_DEFAULT 40 #define PW_LOG_ENABLE_IF_DEFAULT(level, flags) ((level) >= PW_LOG_LEVEL) 41 #endif // PW_LOG_ENABLE_IF_DEFAULT 42