1848b8605Smrg/* 2848b8605Smrg * Copyright (c) 2012 Apple Inc. 3848b8605Smrg * 4848b8605Smrg * Permission is hereby granted, free of charge, to any person 5848b8605Smrg * obtaining a copy of this software and associated documentation files 6848b8605Smrg * (the "Software"), to deal in the Software without restriction, 7848b8605Smrg * including without limitation the rights to use, copy, modify, merge, 8848b8605Smrg * publish, distribute, sublicense, and/or sell copies of the Software, 9848b8605Smrg * and to permit persons to whom the Software is furnished to do so, 10848b8605Smrg * subject to the following conditions: 11848b8605Smrg * 12848b8605Smrg * The above copyright notice and this permission notice shall be 13848b8605Smrg * included in all copies or substantial portions of the Software. 14848b8605Smrg * 15848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16848b8605Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18848b8605Smrg * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT 19848b8605Smrg * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20848b8605Smrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21848b8605Smrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22848b8605Smrg * DEALINGS IN THE SOFTWARE. 23848b8605Smrg * 24848b8605Smrg * Except as contained in this notice, the name(s) of the above 25848b8605Smrg * copyright holders shall not be used in advertising or otherwise to 26848b8605Smrg * promote the sale, use or other dealings in this Software without 27848b8605Smrg * prior written authorization. 28848b8605Smrg */ 29848b8605Smrg 30848b8605Smrg#ifndef APPLE_GLX_LOG_H 31848b8605Smrg#define APPLE_GLX_LOG_H 32848b8605Smrg 33848b8605Smrg#include <sys/cdefs.h> 34848b8605Smrg#include <asl.h> 35848b8605Smrg 36848b8605Smrgvoid apple_glx_log_init(void); 37848b8605Smrg 38848b8605Smrg__printflike(5, 6) 39848b8605Smrgvoid _apple_glx_log(int level, const char *file, const char *function, 40848b8605Smrg int line, const char *fmt, ...); 41848b8605Smrg#define apple_glx_log(l, f, args ...) \ 42b8e80941Smrg _apple_glx_log(l, __FILE__, __func__, __LINE__, f, ## args) 43848b8605Smrg 44848b8605Smrg 45848b8605Smrg__printflike(5, 0) 46848b8605Smrgvoid _apple_glx_vlog(int level, const char *file, const char *function, 47848b8605Smrg int line, const char *fmt, va_list v); 48848b8605Smrg#define apple_glx_vlog(l, f, v) \ 49b8e80941Smrg _apple_glx_vlog(l, __FILE__, __func__, __LINE__, f, v) 50848b8605Smrg 51848b8605Smrg/* This is just here to help the transition. 52848b8605Smrg * TODO: Replace calls to apple_glx_diagnostic 53848b8605Smrg */ 54848b8605Smrg#define apple_glx_diagnostic(f, args ...) \ 55848b8605Smrg apple_glx_log(ASL_LEVEL_DEBUG, f, ## args) 56848b8605Smrg 57848b8605Smrg#endif 58