VBoxGuestLog.h revision aba0e602e244ae7c4f11b50fc6d2440f5a762038
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/** @file
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VBoxGuestLibR0 - Guest Logging facility.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/*
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * available from http://www.virtualbox.org. This file is free software;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * General Public License (GPL) as published by the Free Software
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * The contents of this file may alternatively be used under the terms
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * of the Common Development and Distribution License Version 1.0
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * CDDL are applicable instead of those of the GPL.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * You may elect to license modified versions of this file under the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * terms and conditions of either the GPL or the CDDL or both.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * additional information or have any questions.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#ifndef __VBOXGUESTLOG__H
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#define __VBOXGUESTLOG__H
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#ifndef RT_OS_WINDOWS
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync/* Since I don't know the background for the stuff below, I prefer not to
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync change it. I don't need it or want it for backdoor logging inside the
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync Linux Guest Additions kernel modules though. */
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync/* Update: bird made this the stance on all non-windows platforms. */
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync# include <VBox/log.h>
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync#else /* RT_OS_LINUX not defined */
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync/* Save LOG_ENABLED state, because "VBox/rt/log.h"
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync * may undefine it for IN_RING0 code.
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync */
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync# if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
a0cebf7fbe7defe88df7dcb64e51af63480b7ab0vboxsync# define __LOG_ENABLED_SAVED__
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# endif
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# ifdef VBOX_GUEST
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# include <VBox/log.h>
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# undef Log
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# define Log(a) RTLogBackdoorPrintf a
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# else
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# define Log(a) DbgPrint a
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# endif
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# else
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# define Log(a)
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# endif
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# ifdef __LOG_ENABLED_SAVED__
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# define LOG_ENABLED
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# undef __LOG_ENABLED_SAVED__
cf25f919d659bf00f73e1551230cd6165961061dvboxsync# endif
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#endif /* RT_OS_LINUX not defined */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#endif /* __VBOXGUESTLOG__H */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync