本文整理汇总了C++中LOGIT函数的典型用法代码示例。如果您正苦于以下问题:C++ LOGIT函数的具体用法?C++ LOGIT怎么用?C++ LOGIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOGIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOGIT
ssize_t bbcp_IO::Write(const struct iovec *iovp, int iovn)
{
ssize_t nbytes;
// If logging, add up the bytes to be written
//
if (WKeyA)
{int i;
nbytes = iovp[0].iov_len;
for (i = 1; i < iovn; i++) nbytes += iovp[i].iov_len;
}
// Write data from the buffer. Note that logging only occurs once even though
// we may execute the write multiple times simply because a writev() is an all
// or nothing operation and EINTR's rarely if ever happen on a writev().
//
xfrtime.Start();
LOGIT(WKeyA, nbytes);
while((nbytes = writev(iofd, (const struct iovec *)iovp, iovn)) < 0 &&
errno == EINTR) {}
LOGIT(WKeyZ, (nbytes < 0 ? 0 : nbytes));
xfrtime.Stop();
// All done
//
if (nbytes >= 0) {xfrbytes += nbytes; xfrseek += nbytes;}
else nbytes = -errno;
return nbytes;
}
示例2: while
ssize_t bbcp_IO::Write(char *buff, size_t wrsz, off_t offs)
{
ssize_t nbytes, wlen = 0;
// Write data from the buffer
//
xfrseek = offs;
xfrtime.Start();
while(wrsz > 0)
{LOGIT(WKeyA, wrsz);
if ((nbytes = pwrite(iofd, (void *)buff, wrsz, offs)) < 0)
{int rc = errno;
LOGIT(WKeyZ, 0);
if (rc == EINTR) continue;
break;
}
LOGIT(WKeyZ, nbytes);
wrsz -= nbytes;
wlen += nbytes;
buff += nbytes;
offs += nbytes;
}
xfrtime.Stop();
// All done
//
if (wlen >= 0) {xfrbytes += wlen; xfrseek += wlen;}
else wlen = -errno;
return wlen;
}
示例3: defined
// ----------------------------------------------------------------------------
void MMSapEvents::DumpClipboard()
// ----------------------------------------------------------------------------
{
#if defined(LOGGING)
wxTextDataObject primaryData;
wxTextDataObject normalData;
bool gotPrimaryData = false;
bool gotNormalData = false;
wxString primaryText = wxEmptyString;
wxString normalText = wxEmptyString;
if (wxTheClipboard->Open())
{
wxTheClipboard->UsePrimarySelection(true);
gotPrimaryData = wxTheClipboard->GetData(primaryData);
wxTheClipboard->UsePrimarySelection(false);
gotNormalData = wxTheClipboard->GetData(normalData);
wxTheClipboard->Close();
}
else {
LOGIT(wxT("DumpClipboard: failed to open"));
return;
}
if (gotPrimaryData)
primaryText = primaryData.GetText() ;
if (gotNormalData)
normalText = normalData.GetText() ;
LOGIT(wxT("Clipboard Primary[%s]"), primaryText.c_str() );
LOGIT(wxT("Clipboard Normal[%s]"), normalText.c_str() );
#endif //defined(LOGGING)
}//DumpClipboard
示例4: defined
// ----------------------------------------------------------------------------
void BrowseMarks::Dump()
// ----------------------------------------------------------------------------
{
// get editor by filename in case the editor was close/opened again
#if defined(LOGGING)
EditorBase* eb = m_pEdMgr->GetEditor(m_filePath);
LOGIT( _T("BT --BrowseMarks for[%p][%s]--"), eb, m_fileShortName.c_str() );
cbEditor* cbed = 0;
cbStyledTextCtrl* control = 0;
//cbEditor* cbed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (eb) cbed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(eb);
if (cbed) control = cbed->GetControl();
LOGIT( _T("BT Array[%p] Current[%d]Last[%d]"), this, m_currIndex, m_lastIndex);
for (int i = 0; i < MaxEntries; ++i )
{
const int pos = m_EdPosnArray[i];
if (control && (pos != -1))
LOGIT(_T("BT Array[%p] index[%d]Line[%d]Pos[%d]"), this, i, control->LineFromPosition(pos) ,pos );
else
LOGIT( _T("Array[%p] index[%d]Pos[%d]"), this, i, pos );
}
#endif
}
示例5: LOGIT
// ----------------------------------------------------------------------------
void BrowseSelector::OnNavigationKey(wxKeyEvent &event)
// ----------------------------------------------------------------------------
{
//FIXME: the keys should dynamically reflect the menu cmdkeys
long selected = m_listBox->GetSelection();
long maxItems = m_listBox->GetCount();
long itemToSelect = 0;
LOGIT( _T("OnNavigationKey selected[%ld]maxItems[%ld]key[%d]"), selected, maxItems, event.GetKeyCode() );
if( (event.GetKeyCode() == WXK_RIGHT) || (event.GetKeyCode() == WXK_DOWN) )
{
// Select next page
if (selected == maxItems - 1)
itemToSelect = 0;
else
itemToSelect = selected + 1;
}
if( (event.GetKeyCode() == WXK_LEFT) || (event.GetKeyCode() == WXK_UP) )
{
// Previous page
if( selected == 0 )
itemToSelect = maxItems - 1;
else
itemToSelect = selected - 1;
}
m_listBox->SetSelection( itemToSelect );
LOGIT( _T("OnNavigationKey Selection[%ld]"), itemToSelect );
}
示例6: defined
// ----------------------------------------------------------------------------
void ProjectData::DumpHash( const wxString
#if defined(LOGGING)
hashType
#endif
)
// ----------------------------------------------------------------------------
{
#if defined(LOGGING)
FileBrowse_MarksHash* phash = &m_FileBrowse_MarksArchive;
if ( hashType == wxT("BookMarks") )
phash = &m_FileBook_MarksArchive;
FileBrowse_MarksHash& hash = *phash;
LOGIT( _T("--- DumpProjectHash ---[%s]Count[%d]"), hashType.c_str(), hash.size(), m_ProjectFilename.c_str() );
for (FileBrowse_MarksHash::iterator it = hash.begin(); it != hash.end(); it++)
{
wxString filename = it->first; //an Editor filename withing this project
BrowseMarks* p = it->second; // ptr to array of Editor Browse/Book mark cursor positions
LOGIT( _T("filename[%s]BrowseMark*[%p]name[%s]"), filename.c_str(), p, p->GetFilePath().c_str() );
}
#endif
}
示例7: defined
// ----------------------------------------------------------------------------
void ProjectData::DumpBrowse_Marks( const wxString hashType )
// ----------------------------------------------------------------------------
{
#if defined(LOGGING)
LOGIT( _T("--- DumpBrowseData ---[%s]"), hashType.c_str() );
FileBrowse_MarksHash* phash = &m_FileBrowse_MarksArchive;
if ( hashType == wxT("BookMarks") )
phash = &m_FileBook_MarksArchive;
FileBrowse_MarksHash& hash = *phash;
LOGIT( _T("Dump_%s Size[%d]"), hashType.c_str(), hash.size() );
for (FileBrowse_MarksHash::iterator it = hash.begin(); it != hash.end(); ++it)
{
wxString filename = it->first;
BrowseMarks* p = it->second;
LOGIT( _T("Filename[%s]%s*[%p]name[%s]"), filename.c_str(), hashType.c_str(), p, p->GetFilePath().c_str() );
if (p)
{ //dump the browse marks
p->Dump();
}
}
#endif
}
示例8: fn
// ----------------------------------------------------------------------------
void CodeSnippetsConfig::SettingsLoad()
// ----------------------------------------------------------------------------
{
// file will be saved in $HOME/codesnippets.ini
#ifdef LOGGING
wxString fn(__FUNCTION__, wxConvUTF8);
LOGIT( _T("--- [%s] ---"),fn.c_str() );
LOGIT(wxT("Loading Settings File[%s]"),SettingsSnippetsCfgPath.c_str());
#endif //LOGGING
wxFileConfig cfgFile(
wxEmptyString, // appname
wxEmptyString, // vendor
SettingsSnippetsCfgPath,// local filename
wxEmptyString, // global file
wxCONFIG_USE_LOCAL_FILE);
cfgFile.Read( wxT("ExternalEditor"), &SettingsExternalEditor, wxEmptyString ) ;
cfgFile.Read( wxT("SnippetFile"), &SettingsSnippetsXmlPath, wxEmptyString ) ;
cfgFile.Read( wxT("SnippetFolder"), &SettingsSnippetsFolder, wxEmptyString ) ;
cfgFile.Read( wxT("ViewSearchBox"), &GetConfig()->SettingsSearchBox, true ) ;
cfgFile.Read( wxT("casesensitive"), &m_SearchConfig.caseSensitive, true ) ;
int nScope;
cfgFile.Read( wxT("scope"), &nScope, SCOPE_BOTH ) ;
m_SearchConfig.scope = (SearchScope)nScope;
// read Editors Stay-On-Top of main window option
cfgFile.Read( _T("EditorsStayOnTop"), &SettingsEditorsStayOnTop, true);
// read Editors ToolTips option
cfgFile.Read( _T("ToolTipsOption"), &SettingsToolTipsOption, true);
// Read External App state. Launched App will see it as false because
// plugin has not set it true yet, so if this is launched App, set it true
cfgFile.Read( wxT("ExternalPersistentOpen"), &m_IsExternalPersistentOpen, false ) ;
if ( IsApplication() ) SetExternalPersistentOpen(true);
// read user specified window state (External, Floating, or Docked)
cfgFile.Read( wxT("WindowState"), &m_SettingsWindowState, wxT("Floating") );
#if defined(LOGGING)
LOGIT( _T("WindowState[%s]"), GetSettingsWindowState().c_str() );
#endif
// read last window position
wxString winPos;
cfgFile.Read( wxT("WindowPosition"), &winPos, wxEmptyString) ;
if ( not winPos.IsEmpty() )
{
const wxWX2MBbuf buf = csU2C(winPos);
std::string cstring( buf );
std::stringstream istream(cstring);
istream >> windowXpos ;
istream >> windowYpos ;
istream >> windowWidth ;
istream >> windowHeight ;
}
else
{
示例9: defined
// ----------------------------------------------------------------------------
VALUE RubyClassHandler::SetFocusSketchUp(VALUE self)
// ----------------------------------------------------------------------------
{//static called from Ruby
// Show Ruby Console, but put focus back to SketchUp window
#if defined(LOGGING)
LOGIT( _T("ERSetFocusSketchUp self[%lu]"), self);
#endif
HWND oldhWnd = ::GetFocus();
// This wont work, the WM_COMMAND is in the queue. Window is not up yet.
//unsigned menuId = pHiddenFrame->GetMenuIdFromPath(_T("Window/Ruby Console"));
//LRESULT lresult = ::SendMessage( g_hWndSketchUp, WM_COMMAND, menuId, 0);
//HWND rubyConsole = ::FindWindow("#32770", "Ruby Console");
HWND fghWnd = ::GetForegroundWindow();
if ( oldhWnd == g_hWndSketchUpView)
return Qtrue;
if ( fghWnd == g_hWndSketchUp)
{
return Qtrue;
}
::EnableWindow( g_hWndSketchUp, TRUE );
::EnableWindow( g_hWndSketchUpView, TRUE );
::SetForegroundWindow(g_hWndSketchUp);
::SetFocus(g_hWndSketchUpView);
HWND newhWnd = ::GetFocus();
HWND newfgWnd = ::GetForegroundWindow();
//if ( lresult || oldhWnd || newhWnd || rubyConsole ) {;} //shush compiler unused warning
#if defined(LOGGING)
LOGIT( _T("ERSetFocusSketchUp OldFocus[%p] NewFocus[%p]] "),
(void*)oldhWnd, (void*)newhWnd);
LOGIT( _T("ERSetFocusSketchUp ForeGrnd[%p] SketchUp[%p]]"),
(void*)fghWnd, (void*)g_hWndSketchUp);
#endif
#if defined(LOGGING)
LOGIT( _T("ERSetFocusSketchUp self[%lu] Focus[%s]"), self,
( newhWnd == g_hWndSketchUp )?_T("TRUE":_T("FALSE")));
#endif
if ( newhWnd == g_hWndSketchUpView )
return Qtrue;
if ( newfgWnd == g_hWndSketchUp )
return Qtrue;
return Qfalse;
}
示例10: _T
// ----------------------------------------------------------------------------
bool CodeSnippetsEvent::PostCodeSnippetsEvent(const CodeSnippetsEvent& event)
// ----------------------------------------------------------------------------
{
// Propagate CodeSnippetsEvent to ThreadSearchFrame
// They wont get there otherwise.
// Here we append the events to the lowest window that
// might conceivable want the CodeSnippetsEvents (niz., "Flat Notebook")
// "Flat Notebook" belongs to both CodeSnippets() *and* ThreadSearch() frames
// when ThreadSearch() re-parented ThreadSearchView() and cbEditor wxNotebook
// into ThreadSearchFrame's wxSplitterWindow.
// That way, the events propagate back up both frame chains for all to see.
Utils utils;
////#if defined(LOGGING)
//// int snippetID = event.GetSnippetID();
//// wxString snippetString = event.GetSnippetString();
//// wxString eventTypeLabel = event.GetEventTypeLabel();
//// LOGIT( _T("PostCodeSnippetsEvent type[%s]id[%d]str[%s]"), eventTypeLabel.c_str(), snippetID, snippetString.c_str());
////#endif
wxWindow* pCodeSnippetsTreeCtrl = (wxWindow*)GetConfig()->GetSnippetsTreeCtrl();
wxWindow* pSearchPath = utils.FindWindowRecursively( (wxWindow*)GetConfig()->GetThreadSearchFrame(), _T("SCIwindow") );
#if defined(LOGGING)
if ( pCodeSnippetsTreeCtrl)
LOGIT( _T("PostCodeSnippetsEvent TreeCtrl[%p][%s]"), pCodeSnippetsTreeCtrl, pCodeSnippetsTreeCtrl->GetName().c_str());
if ( pSearchPath )
LOGIT( _T("PostCodeSnippetsEvent SrchPath[%p][%s]"), pSearchPath, pSearchPath->GetName().c_str());
#endif
// Propagate the event to ThreadSearchFrame
if ( pSearchPath && pCodeSnippetsTreeCtrl)
{
#if wxCHECK_VERSION(2, 9, 0)
pSearchPath->GetEventHandler()->AddPendingEvent( (wxEvent&)event );
pCodeSnippetsTreeCtrl->GetEventHandler()->AddPendingEvent( (wxEvent&)event );
#else
pSearchPath->AddPendingEvent( (wxEvent&)event );
pCodeSnippetsTreeCtrl->AddPendingEvent( (wxEvent&)event );
#endif
}
else
{
#if defined(LOGGING)
LOGIT( _T("PostCodeSnippetsEvent[%s]"), _T("Failed"));
#endif
return false;
}
return true;
}//PostCodeSnippetsEvent
示例11: LOGIT
void VikeEvtBinder::OnFocus(wxFocusEvent &event)
{
LOGIT(_("on focus"));
cbEditor *edBase = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
wxScintilla *editor = NULL;
if(edBase){
editor = (wxScintilla *)edBase->GetControl();
LOGIT(_T("window is %p, edbase is %p, editor is %p"),event.GetWindow(), edBase, editor);
m_pVikeWin->UpdateStatusBar();
m_pVikeWin->UpdateCaret((wxScintilla *)editor);
}
event.Skip();
}
示例12: defined
// ----------------------------------------------------------------------------
void Navigator::OnMenuJumpBack(wxCommandEvent &/*event*/)
// ----------------------------------------------------------------------------
{
int tailPlusOne;
#if defined(LOGGING)
LOGIT( _T("JT [%s]"), _T("OnMenuJumpBack"));
#endif
tailPlusOne = m_Tail+1;
if(tailPlusOne >= POS_BUFFER_SIZE )
tailPlusOne = 0;
// Can we go further back
if( m_Cursor == tailPlusOne)
return;
m_Cursor--;
if(m_Cursor == -1)
m_Cursor = POS_BUFFER_SIZE-1;
EditorManager* edmgr = Manager::Get()->GetEditorManager();
wxString edFilename = m_ArrayOfJumpData[m_Cursor].m_Filename;
long edPosn = m_ArrayOfJumpData[m_Cursor].m_Posn;
#if defined(LOGGING)
LOGIT( _T("JT OnMenuJumpBack [%s][%ld]curs[%d]"), edFilename.c_str(), edPosn, m_Cursor);
#endif
// activate editor
cbEditor* ed = edmgr->Open(edFilename);
if(ed)
{
cbStyledTextCtrl* control = ed->GetControl();
ed->GotoLine(ed->GetControl()->LineFromPosition(edPosn)); //center on scrn
ed->SetFocus();
control->GotoPos(edPosn);
}
#if defined(LOGGING)
LOGIT( _T("JT [%s]"), _T("END OnMenuJumpBack"));
#endif
}
示例13: GetConfig
// ----------------------------------------------------------------------------
void SnippetProperty::InvokeEditOnSnippetFile()
// ----------------------------------------------------------------------------
{
// Open as file
if (not IsSnippetFile() ) return;
// If snippet is file, open it
wxString FileName = GetConfig()->GetSnippetsTreeCtrl()->GetSnippetFileLink();
// we have an actual file name, not just text
wxString pgmName = GetConfig()->SettingsExternalEditor;
if ( pgmName.IsEmpty() )
{
#if defined(__WXMSW__)
pgmName = wxT("notepad");
#elif defined(__UNIX__)
pgmName = wxT("gedit");
#endif
}
// file name must be surrounded with quotes when using wxExecute
wxString execString = pgmName + wxT(" \"") + FileName + wxT("\"");
#ifdef LOGGING
LOGIT( _T("InvokeEditOnSnippetFile[%s]"), execString.GetData() );
#endif //LOGGING
::wxExecute( execString);
return;
}//InvokeEditOnSnippetFile
示例14: m_pVike
VikeEvtBinder::VikeEvtBinder(cbVike *vike, cbStyledTextCtrl* controller, cbEditor *editor)
: m_pVike(vike), m_pTarget(controller), m_pEditor(editor)
{
VikeStatusBar *bar = nullptr;
wxArrayPtrVoid *found = vike->FindHandlerFor(editor);
if(found->Count() == 0){
LOGIT(_T("new status bar"));
bar = new VikeStatusBar(editor, wxSB_NORMAL);
}else{
LOGIT(_T("old status bar"));
bar = ((VikeEvtBinder *)found->Item(0))->GetVikeWin()->GetStatusBar();
}
m_pVikeWin = new VikeWin(controller, editor, bar);
m_pTarget->PushEventHandler(this);
delete found;
}
示例15: LOGIT
void UserIdCache::updateItem(const QString &userId, int taskId)
{
LOGIT("updateItem() A");
UserIdList::iterator curr;
for (curr = _userIdList->begin(); curr != _userIdList->end(); curr++) {
if (((curr->getUserId()).compare(userId) == 0) && (curr->getTaskId() == -1)) {
qDebug() << "EEEE UserIdCache::updateItem - unassigned entry found for userId=" << userId << endl;
curr->setTaskId(taskId);
LOGIT("updateItem() B");
return;
}
}
qWarning() << "EEEE UserIdCache::updateItem - NO unassigned entries found for userId=" << userId << endl;
}