errorprint.cpp revision 15e9181ff43bf09ce40eaab73cee8c8492f99878
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * MS COM / XPCOM Abstraction Layer:
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * Error info print helpers. This implements the shared code from the macros from errorprint.h.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * Copyright (C) 2009 Oracle Corporation
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * available from http://www.virtualbox.org. This file is free software;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * you can redistribute it and/or modify it under the terms of the GNU
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * General Public License (GPL) as published by the Free Software
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync "Details: code %Rhrc (0x%RX32), component %ls, interface %ls, callee %ls\n"
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // print and log
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsyncvoid GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine)
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // pcszSourceFile comes from __FILE__ macro, which always contains the full path,
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // which we don't want to see printed:
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync Utf8Str strFilename(RTPathFilename(pcszSourceFile));
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync Utf8Str str = Utf8StrFmt("Context: \"%s\" at line %d of file %s\n",
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // print and log
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync Utf8Str str = Utf8StrFmt("ERROR: code %Rhra (extended info not available)\n", rc);
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // print and log
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync // if we have full error info, print something nice, and start with the actual error message