diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-03-18 01:32:09 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-03-18 01:32:09 +0000 |
commit | cf8c8a0c585fd30bdb53a81f6be148a02606c610 (patch) | |
tree | d39bea5d12d806655bd8c9a110be3588910ccd0b /src/modules/extra | |
parent | 3765c691250be52032943c152c2f4fe524686ae8 (diff) |
Add logging for static callback messages/errors from the database.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9119 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_mssql.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 74886863d..ab4d2aa71 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -447,17 +447,15 @@ class SQLConn : public classbase static int HandleMessage(const TDSCONTEXT * pContext, TDSSOCKET * pTdsSocket, TDSMESSAGE * pMessage) { - /* TODO: FIXME */ - //Instance->Logs->Log("m_mssql",DEBUG,pMessage->message); - //printf("Message: %s\n", pMessage->message); + SQLConn* sc = (SQLConn*)pContext->parent; + sc->Instance->Logs->Log("m_mssql", DEBUG, "Message for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message); return 0; } static int HandleError(const TDSCONTEXT * pContext, TDSSOCKET * pTdsSocket, TDSMESSAGE * pMessage) { - /* TODO: FIXME */ - //Instance->Logs->Log("m_mssql",DEBUG,pMessage->message); - //printf("Error: %s\n", pMessage->message); + SQLConn* sc = (SQLConn*)pContext->parent; + sc->Instance->Logs->Log("m_mssql", DEFAULT, "Error for DB with id: %s -> %s", sc->host.id.c_str(), pMessage->message); return 0; } @@ -476,7 +474,7 @@ class SQLConn : public classbase CloseDB(); TDSCONTEXT* cont; - cont = tds_alloc_context(NULL); + cont = tds_alloc_context(this); cont->msg_handler = HandleMessage; cont->err_handler = HandleError; |