VirtualBox

Changeset 16580 in vbox for trunk/src/VBox/Main/glue


Ignore:
Timestamp:
Feb 9, 2009 12:07:53 PM (16 years ago)
Author:
vboxsync
Message:

Main: make new error functions more granular

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/errorprint2.cpp

    r16555 r16580  
    5050}
    5151
     52void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine)
     53{
     54    // pcszSourceFile comes from __FILE__ macro, which always contains the full path,
     55    // which we don't want to see printed:
     56    Utf8Str strFilename(RTPathFilename(pcszSourceFile));
     57    Utf8Str str = Utf8StrFmt("Context: \"%s\" at line %d of file %s\n",
     58                                pcszContext,
     59                                ulLine,
     60                                strFilename.c_str());
     61    // print and log
     62    RTPrintf("%s", str.c_str());
     63    Log(("%s", str.c_str()));
     64}
     65
    5266void GluePrintRCMessage(HRESULT rc)
    5367{
     
    6781    com::ErrorInfo info(iface);
    6882    if (info.isFullAvailable() || info.isBasicAvailable())
    69     {
    7083        GluePrintErrorInfo(info);
    71 
    72         // pcszSourceFile comes from __FILE__ macro, which always contains the full path,
    73         // which we don't want to see printed:
    74         Utf8Str strFilename(RTPathFilename(pcszSourceFile));
    75         Utf8Str str = Utf8StrFmt("Context: \"%s\" at line %d of file %s\n",
    76                                  pcszContext,
    77                                  ulLine,
    78                                  strFilename.c_str());
    79         // print and log
    80         RTPrintf("%s", str.c_str());
    81         Log(("%s", str.c_str()));
    82     }
     84    GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine);
    8385}
    8486
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette