本文整理汇总了C++中LogManager::GetLogChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ LogManager::GetLogChannel方法的具体用法?C++ LogManager::GetLogChannel怎么用?C++ LogManager::GetLogChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogManager
的用法示例。
在下文中一共展示了LogManager::GetLogChannel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDisableAll
UI::EventReturn LogConfigScreen::OnDisableAll(UI::EventParams &e) {
LogManager *logMan = LogManager::GetInstance();
for (int i = 0; i < LogManager::GetNumChannels(); i++) {
LogChannel *chan = logMan->GetLogChannel((LogTypes::LOG_TYPE)i);
chan->enabled = false;
}
return UI::EVENT_DONE;
}
示例2: OnToggleAll
UI::EventReturn LogConfigScreen::OnToggleAll(UI::EventParams &e) {
LogManager *logMan = LogManager::GetInstance();
for (int i = 0; i < LogManager::GetNumChannels(); i++) {
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
LogChannel *chan = logMan->GetLogChannel(type);
chan->enable_ = !chan->enable_;
}
return UI::EVENT_DONE;
}
示例3: OnCompleted
void LogLevelScreen::OnCompleted(DialogResult result) {
if (result != DR_OK)
return;
int selected = listView_->GetSelected();
LogManager *logMan = LogManager::GetInstance();
for (int i = 0; i < LogManager::GetNumChannels(); ++i) {
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
LogChannel *chan = logMan->GetLogChannel(type);
if(chan->enable_ )
chan->level_ = selected + 1;
}
}
示例4: CreateViews
void LogConfigScreen::CreateViews() {
using namespace UI;
I18NCategory *di = GetI18NCategory("Dialog");
I18NCategory *dev = GetI18NCategory("Developer");
root_ = new ScrollView(ORIENT_VERTICAL);
LinearLayout *vert = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
vert->SetSpacing(0);
LinearLayout *topbar = new LinearLayout(ORIENT_HORIZONTAL);
topbar->Add(new Choice(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
topbar->Add(new Choice(di->T("Toggle All")))->OnClick.Handle(this, &LogConfigScreen::OnToggleAll);
topbar->Add(new Choice(di->T("Enable All")))->OnClick.Handle(this, &LogConfigScreen::OnEnableAll);
topbar->Add(new Choice(di->T("Disable All")))->OnClick.Handle(this, &LogConfigScreen::OnDisableAll);
topbar->Add(new Choice(dev->T("Log Level")))->OnClick.Handle(this, &LogConfigScreen::OnLogLevel);
vert->Add(topbar);
vert->Add(new ItemHeader(dev->T("Logging Channels")));
LogManager *logMan = LogManager::GetInstance();
int cellSize = 400;
UI::GridLayoutSettings gridsettings(cellSize, 64, 5);
gridsettings.fillCells = true;
GridLayout *grid = vert->Add(new GridLayout(gridsettings, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
for (int i = 0; i < LogManager::GetNumChannels(); i++) {
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
LogChannel *chan = logMan->GetLogChannel(type);
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(cellSize - 50, WRAP_CONTENT));
row->SetSpacing(0);
row->Add(new CheckBox(&chan->enabled, "", "", new LinearLayoutParams(50, WRAP_CONTENT)));
row->Add(new PopupMultiChoice((int *)&chan->level, chan->m_shortName, logLevelList, 1, 6, 0, screenManager(), new LinearLayoutParams(1.0)));
grid->Add(row);
}
}