1 /* 2 * 3 * Copyright 2019, The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef LIBTEEUI_INCLUDE_TEEUI_LOG_H_ 19 #define LIBTEEUI_INCLUDE_TEEUI_LOG_H_ 20 21 #ifdef TEEUI_DO_LOG_DEBUG 22 #include <iomanip> 23 #include <iostream> 24 #define TEEUI_LOG std::cout 25 #define ENDL std::endl 26 #else 27 #define TEEUI_LOG ::teeui::bits::silencer 28 #define ENDL 0 29 #endif 30 31 namespace teeui { 32 namespace bits { 33 34 struct silencer_t {}; 35 static silencer_t silencer; 36 37 template <typename T> silencer_t& operator<<(silencer_t& out, const T&) { 38 return out; 39 } 40 41 } // namespace bits 42 } // namespace teeui 43 44 #endif // LIBTEEUI_INCLUDE_TEEUI_LOG_H_ 45