VirtualBox

Changeset 24934 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2009 10:50:52 AM (15 years ago)
Author:
vboxsync
Message:

Main: Logging.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MediumAttachmentImpl.cpp

    r24511 r24934  
    2222#include "MediumAttachmentImpl.h"
    2323#include "MachineImpl.h"
     24#include "Global.h"
    2425
    2526#include "Logging.h"
     
    8990    autoInitSpan.setSucceeded();
    9091
    91     LogFlowThisFuncLeave();
     92    /* Construct a short log name for this attachment. */
     93    Utf8Str ctlName(aControllerName);
     94    const char *psz = strpbrk(ctlName.c_str(), " \t:-");
     95    mLogName = Utf8StrFmt("MA%p[%.*s:%u:%u:%s%s]",
     96                          this,
     97                          psz ? psz - ctlName.c_str() : 4, ctlName.c_str(),
     98                          aPort, aDevice, Global::stringifySessionState(aType),
     99                          aImplicit ? ":I" : "");
     100
     101    LogFlowThisFunc(("LEAVE - %s\n", logName()));
    92102    return S_OK;
    93103}
     
    99109void MediumAttachment::uninit()
    100110{
    101     LogFlowThisFuncEnter();
     111    LogFlowThisFunc(("ENTER - %s\n", logName()));
    102112
    103113    /* Enclose the state transition Ready->InUninit->NotReady */
     
    118128bool MediumAttachment::rollback()
    119129{
    120     LogFlowThisFuncEnter();
     130    LogFlowThisFunc(("ENTER - %s\n", logName()));
    121131
    122132    /* sanity */
     
    136146    }
    137147
    138     LogFlowThisFuncLeave();
     148    LogFlowThisFunc(("LEAVE - %s - returning %RTbool\n", logName(), changed));
    139149    return changed;
    140150}
  • trunk/src/VBox/Main/include/MediumAttachmentImpl.h

    r24511 r24934  
    109109    }
    110110
     111    /** Get a unique and somewhat descriptive name for logging. */
     112    const char *logName(void) const { return mLogName.c_str(); }
     113
    111114    /** For com::SupportErrorInfoImpl. */
    112115    static const char *ComponentName() { return "MediumAttachment"; }
     
    144147
    145148    Backupable<Data> m;
     149
     150    Utf8Str mLogName;                   /**< For logging purposes */
    146151};
    147152
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