Better debug prints: tell which tag we're creating

This commit is contained in:
akkana%netscape.com 1999-09-10 22:34:18 +00:00
parent 96799ab633
commit 8fd31a2323
4 changed files with 32 additions and 8 deletions

View File

@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn()
NS_IMETHODIMP CreateElementTxn::Do(void)
{
if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n",
mParent.get(), mOffsetInParent); }
if (gNoisy)
{
char* nodename = mTag.ToNewCString();
printf("Do Create Element parent = %p <%s>, offset = %d\n",
mParent.get(), nodename, mOffsetInParent);
nsAllocator::Free(nodename);
}
NS_ASSERTION(mEditor && mParent, "bad state");
if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result;

View File

@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{
nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode);
nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent);
printf("%p Do Insert Element of %p into parent %p at offset %d\n",
this, nodeAsContent.get(), parentAsContent.get(), mOffset);
nsString namestr;
mNode->GetNodeName(namestr);
char* nodename = namestr.ToNewCString();
printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n",
this, nodeAsContent.get(), nodename,
parentAsContent.get(), mOffset);
nsAllocator::Free(nodename);
}
if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result;

View File

@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn()
NS_IMETHODIMP CreateElementTxn::Do(void)
{
if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n",
mParent.get(), mOffsetInParent); }
if (gNoisy)
{
char* nodename = mTag.ToNewCString();
printf("Do Create Element parent = %p <%s>, offset = %d\n",
mParent.get(), nodename, mOffsetInParent);
nsAllocator::Free(nodename);
}
NS_ASSERTION(mEditor && mParent, "bad state");
if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result;

View File

@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{
nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode);
nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent);
printf("%p Do Insert Element of %p into parent %p at offset %d\n",
this, nodeAsContent.get(), parentAsContent.get(), mOffset);
nsString namestr;
mNode->GetNodeName(namestr);
char* nodename = namestr.ToNewCString();
printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n",
this, nodeAsContent.get(), nodename,
parentAsContent.get(), mOffset);
nsAllocator::Free(nodename);
}
if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result;