2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef EMUGL_COMMON_LOGGING_H_
18 #define EMUGL_COMMON_LOGGING_H_
20 #pragma GCC diagnostic push
21 #pragma GCC diagnostic ignored "-Wredundant-decls"
34 typedef void (*logger_t)(const emugl::LogLevel &level, const char* fmt, ...);
35 extern logger_t emugl_logger;
36 extern logger_t emugl_cxt_logger;
37 void set_emugl_logger(logger_t f);
38 void set_emugl_cxt_logger(logger_t f);
44 #define GL_LOG(...) do { \
45 emugl_logger(__VA_ARGS__); \
48 #define GL_CXT_LOG(...) do { \
49 emugl_cxt_logger(__VA_ARGS__); \
56 #pragma GCC diagnostic pop