[6549] | 1 | /* $Id: logbackdoor-redirect.cpp 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
[19120] | 3 | * VirtualBox Runtime - RTLog stubs for the stripped down IPRT used by
|
---|
| 4 | * RuntimeGuestR3Shared (X11), output is redirected
|
---|
| 5 | * to the RTLogBackdoor API where possible.
|
---|
[6549] | 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
[98103] | 9 | * Copyright (C) 2007-2023 Oracle and/or its affiliates.
|
---|
[6549] | 10 | *
|
---|
[96407] | 11 | * This file is part of VirtualBox base platform packages, as
|
---|
| 12 | * available from https://www.virtualbox.org.
|
---|
[6549] | 13 | *
|
---|
[96407] | 14 | * This program is free software; you can redistribute it and/or
|
---|
| 15 | * modify it under the terms of the GNU General Public License
|
---|
| 16 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 17 | * License.
|
---|
| 18 | *
|
---|
| 19 | * This program is distributed in the hope that it will be useful, but
|
---|
| 20 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 22 | * General Public License for more details.
|
---|
| 23 | *
|
---|
| 24 | * You should have received a copy of the GNU General Public License
|
---|
| 25 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 26 | *
|
---|
[6549] | 27 | * The contents of this file may alternatively be used under the terms
|
---|
| 28 | * of the Common Development and Distribution License Version 1.0
|
---|
[96407] | 29 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
| 30 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
[6549] | 31 | * CDDL are applicable instead of those of the GPL.
|
---|
| 32 | *
|
---|
| 33 | * You may elect to license modified versions of this file under the
|
---|
| 34 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[96407] | 35 | *
|
---|
| 36 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
[6549] | 37 | */
|
---|
| 38 |
|
---|
[55980] | 39 |
|
---|
[57358] | 40 | /*********************************************************************************************************************************
|
---|
| 41 | * Header Files *
|
---|
| 42 | *********************************************************************************************************************************/
|
---|
[6549] | 43 | #include <VBox/log.h>
|
---|
[76474] | 44 | #include <iprt/errcore.h>
|
---|
[6549] | 45 |
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | /* All release logging goes to the backdoor logger anyway. */
|
---|
[55980] | 49 | RTDECL(PRTLOGGER) RTLogRelGetDefaultInstance(void)
|
---|
[6549] | 50 | {
|
---|
| 51 | return NULL;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
[6551] | 54 |
|
---|
[55980] | 55 | /* All release logging goes to the backdoor logger anyway. */
|
---|
[55988] | 56 | RTDECL(PRTLOGGER) RTLogRelGetDefaultInstanceEx(uint32_t fFlagsAndGroup)
|
---|
[55980] | 57 | {
|
---|
| 58 | return NULL;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 |
|
---|
[6549] | 62 | /* All logging goes to the backdoor logger anyway. */
|
---|
| 63 | RTDECL(PRTLOGGER) RTLogDefaultInstance(void)
|
---|
| 64 | {
|
---|
| 65 | return NULL;
|
---|
| 66 | }
|
---|
| 67 |
|
---|
[55980] | 68 |
|
---|
[7602] | 69 | /* All logging goes to the backdoor logger anyway. */
|
---|
[55988] | 70 | RTDECL(PRTLOGGER) RTLogDefaultInstanceEx(uint32_t fFlagsAndGroup)
|
---|
[55980] | 71 | {
|
---|
| 72 | return NULL;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | /* All logging goes to the backdoor logger anyway. */
|
---|
[7602] | 77 | RTDECL(PRTLOGGER) RTLogRelSetDefaultInstance(PRTLOGGER pLogger)
|
---|
| 78 | {
|
---|
| 79 | return NULL;
|
---|
| 80 | }
|
---|
[6551] | 81 |
|
---|
[55980] | 82 |
|
---|
[6549] | 83 | RTDECL(void) RTLogRelPrintf(const char *pszFormat, ...)
|
---|
| 84 | {
|
---|
[11682] | 85 | va_list va;
|
---|
[6549] | 86 |
|
---|
[11682] | 87 | va_start(va, pszFormat);
|
---|
| 88 | RTLogBackdoorPrintfV(pszFormat, va);
|
---|
| 89 | va_end(va);
|
---|
[6549] | 90 | }
|
---|
| 91 |
|
---|
[6551] | 92 |
|
---|
[11682] | 93 | RTDECL(void) RTLogRelPrintfV(const char *pszFormat, va_list va)
|
---|
[6549] | 94 | {
|
---|
[11682] | 95 | RTLogBackdoorPrintfV(pszFormat, va);
|
---|
[6549] | 96 | }
|
---|
| 97 |
|
---|
[11682] | 98 |
|
---|
[11640] | 99 | RTDECL(void) RTLogLoggerEx(PRTLOGGER pLogger, unsigned fFlags, unsigned iGroup, const char *pszFormat, ...)
|
---|
| 100 | {
|
---|
[11682] | 101 | va_list va;
|
---|
| 102 |
|
---|
| 103 | va_start(va, pszFormat);
|
---|
| 104 | RTLogBackdoorPrintfV(pszFormat, va);
|
---|
| 105 | va_end(va);
|
---|
[11640] | 106 | }
|
---|
[6551] | 107 |
|
---|
[11682] | 108 |
|
---|
[6549] | 109 | RTDECL(void) RTLogPrintf(const char *pszFormat, ...)
|
---|
| 110 | {
|
---|
[11682] | 111 | va_list va;
|
---|
[6549] | 112 |
|
---|
[11682] | 113 | va_start(va, pszFormat);
|
---|
| 114 | RTLogBackdoorPrintfV(pszFormat, va);
|
---|
| 115 | va_end(va);
|
---|
[6549] | 116 | }
|
---|
| 117 |
|
---|
[6551] | 118 |
|
---|
[11682] | 119 | RTDECL(void) RTLogPrintfV(const char *pszFormat, va_list va)
|
---|
[6549] | 120 | {
|
---|
[11682] | 121 | RTLogBackdoorPrintfV(pszFormat, va);
|
---|
[6549] | 122 | }
|
---|
| 123 |
|
---|
[6551] | 124 |
|
---|
[6549] | 125 | /* Do nothing for now. */
|
---|
[57974] | 126 | RTDECL(void) RTLogFlush(PRTLOGGER pLogger)
|
---|
[6549] | 127 | {
|
---|
[57974] | 128 | NOREF(pLogger);
|
---|
[6549] | 129 | }
|
---|
[6551] | 130 |
|
---|
[7602] | 131 | /* Do nothing. */
|
---|
| 132 | RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
|
---|
| 133 | const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
|
---|
[36408] | 134 | RTUINT fDestFlags, const char *pszFilenameFmt, ...)
|
---|
[7602] | 135 | {
|
---|
| 136 | return VERR_NOT_IMPLEMENTED;
|
---|
| 137 | }
|
---|
[55980] | 138 |
|
---|