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 #include <stdint.h> 17 18 // These configuration options differ from the options in pw_log/options.h in 19 // that these should be set at a global level in the build system rather than 20 // at a module or compile unit level. 21 22 // PW_LOG_LEVEL_DEFAULT controls the default value of PW_LOG_LEVEL. 23 // 24 // Defaults to PW_LOG_LEVEL_DEBUG. 25 #ifndef PW_LOG_LEVEL_DEFAULT 26 #define PW_LOG_LEVEL_DEFAULT PW_LOG_LEVEL_DEBUG 27 #endif // PW_LOG_LEVEL_DEFAULT 28 29 // PW_LOG_FLAGS_DEFAULT controls the default value of PW_LOG_FLAGS. 30 // 31 // For log statements like LOG_INFO that don't have an explicit argument, this 32 // is used for the flags value. 33 #ifndef PW_LOG_FLAGS_DEFAULT 34 #define PW_LOG_FLAGS_DEFAULT 0 35 #endif // PW_LOG_FLAGS_DEFAULT 36 37 // PW_LOG_ENABLE_IF controls what logs are enabled 38 // 39 // This expression determines whether or not the statement is enabled and 40 // should be passed to the backend. 41 #ifndef PW_LOG_ENABLE_IF 42 #define PW_LOG_ENABLE_IF(level, verbosity, module, flags) \ 43 ((int32_t)(level) >= (int32_t)(verbosity)) 44 #endif // PW_LOG_ENABLE_IF 45