• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QLOG_WARN函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QLOG_WARN函数的典型用法代码示例。如果您正苦于以下问题:C++ QLOG_WARN函数的具体用法?C++ QLOG_WARN怎么用?C++ QLOG_WARN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QLOG_WARN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QLOG_WARN

void APMFirmwareVersion::parseVersion(const QString &versionText)
{
    if (versionText.isEmpty()) {
        return;
    }


    if (VERSION_REXP.indexIn(versionText) == -1) {
        QLOG_WARN() << "firmware version regex didn't match anything"
                                        << "version text to be parsed" << versionText;
        return;
    }

    QStringList capturedTexts = VERSION_REXP.capturedTexts();

    if (capturedTexts.count() < 5) {
        QLOG_WARN() << "something wrong with parsing the version text, not hitting anything"
                                        << VERSION_REXP.captureCount() << VERSION_REXP.capturedTexts();
        return;
    }

    // successful extraction of version numbers
    // even though we could have collected the version string atleast
    // but if the parsing has faild, not much point
    _versionString = versionText;
    _vehicleType   = capturedTexts[1];
    _major         = capturedTexts[2].toInt();
    _minor         = capturedTexts[3].toInt();
    _patch         = capturedTexts[4].toInt();
}
开发者ID:AndKe,项目名称:apm_planner,代码行数:30,代码来源:APMFirmwareVersion.cpp


示例2: fi

void SystemComponent::runUserScript(QString script)
{
  // We take the path the user supplied and run it through fileInfo and
  // look for the fileName() part, this is to avoid people sharing keymaps
  // that tries to execute things like ../../ etc. Note that this function
  // is still not safe, people can do nasty things with it, so users needs
  // to be careful with their keymaps.
  //
  QFileInfo fi(script);
  QString scriptPath = Paths::dataDir("scripts/" + fi.fileName());

  QFile scriptFile(scriptPath);
  if (scriptFile.exists())
  {
    if (!QFileInfo(scriptFile).isExecutable())
    {
      QLOG_WARN() << "Script:" << script << "is not executable";
      return;
    }

    QLOG_INFO() << "Running script:" << scriptPath;

    if (QProcess::startDetached(scriptPath, QStringList()))
      QLOG_DEBUG() << "Script started successfully";
    else
      QLOG_WARN() << "Error running script:" << scriptPath;
  }
  else
  {
    QLOG_WARN() << "Could not find script:" << scriptPath;
  }
}
开发者ID:imbavirus,项目名称:plex-media-player,代码行数:32,代码来源:SystemComponent.cpp


示例3: jobInfo

QString Server::replaceMacros(QString const& input, Process* process)
{
    JobInfo* jobInfo(process->jobInfo());
    QString output(input);
    qDebug() << "Server::replaceMacros:";
    qDebug() << output;

    output.replace("${QC}",        m_qchemEnvironment);
    output.replace("${EXE_NAME}",  m_executableName);
    output.replace("${JOB_ID}",    process->id());
    output.replace("${JOB_NAME}",  jobInfo->get(JobInfo::BaseName));
    output.replace("${QUEUE}",     jobInfo->get(JobInfo::Queue));
    output.replace("${WALLTIME}",  jobInfo->get(JobInfo::Walltime));
    output.replace("${MEMORY}",    jobInfo->get(JobInfo::Memory));
    output.replace("${JOBFS}",     jobInfo->get(JobInfo::Jobfs));
    output.replace("${NCPUS}",     jobInfo->get(JobInfo::Ncpus));

    if (output.contains("${")) {
        QLOG_WARN() << "Unmatched macros found in string:";
        QLOG_WARN() << input;
    }
    qDebug() << "Substituted output";
    qDebug() << output;

    return output;
}
开发者ID:baneofblabs,项目名称:IQmol,代码行数:26,代码来源:Server.C


示例4: output

QString Server::replaceMacros(QString const& input, Process* process)
{
   QString output(input);
   //qDebug() << "Server::replaceMacros on string:" << output;

   output.replace("${USER}",      m_userName);
//   output.replace("${QC}",        m_qchemEnvironment);
   output.replace("${EXE_NAME}",  m_executableName);
   // bit of a hack, we don't need the executable name for an HTTP server, so
   // we store the location of the cgi scripts instead.
   output.replace("${CGI_ROOT}",  m_executableName);  
   output.replace("${SERVER}",    m_name);  

   if (process) {
      JobInfo* jobInfo(process->jobInfo());
      output.replace("${JOB_ID}",   process->id());
      output.replace("${JOB_NAME}", jobInfo->get(JobInfo::BaseName));
      output.replace("${QUEUE}",    jobInfo->get(JobInfo::Queue));
      output.replace("${WALLTIME}", jobInfo->get(JobInfo::Walltime));
      output.replace("${MEMORY}",   jobInfo->get(JobInfo::Memory));
      output.replace("${JOBFS}",    jobInfo->get(JobInfo::Scratch));
      output.replace("${SCRATCH}",  jobInfo->get(JobInfo::Scratch));
      output.replace("${NCPUS}",    jobInfo->get(JobInfo::Ncpus));
   }

   if (output.contains("${")) {
      QLOG_WARN() << "Unmatched macros found in string:";
      QLOG_WARN() << input;
   }

   QLOG_DEBUG() << "Substituted output: " << output;

   return output;
}
开发者ID:gechen,项目名称:IQmol,代码行数:34,代码来源:Server.C


示例5: indexOf

bool QsLanguage::setApplicationLanguage(const int newLanguageId)
{
   const int newLanguageIndex = indexOf(newLanguageId);
   if( -1 == newLanguageIndex )
      return false;

   const LanguageItem& newLanguage = mLanguages.at(newLanguageIndex);
   if( newLanguage.id == mApplicationLanguage )
      return true;

   // remove current translators
   if( mLangIdToTranslator.contains(mApplicationLanguage) )
      qApp->removeTranslator(mLangIdToTranslator.value(mApplicationLanguage, NULL));
   if( mLangIdToQtTranslator.contains(mApplicationLanguage) )
      qApp->removeTranslator(mLangIdToQtTranslator.value(mApplicationLanguage, NULL));

   if( newLanguageId == defaultLanguage().id )
   {
      mApplicationLanguage = newLanguageId;
      return true; // the default language doesn't need translators
   }

   const QString appDir = qApp->applicationDirPath();
   if( mLangIdToQtTranslator.contains(newLanguageId) )
      qApp->installTranslator(mLangIdToQtTranslator.value(newLanguageId, NULL));
   else // try to load from disk
   {
      QScopedPointer<QTranslator> t(new QTranslator);
      const bool loadedQt =
         t->load(QString("qt_%1.qm").arg(newLanguage.shortName),
         appDir);
      if( !loadedQt )
      {
         QLOG_WARN() << "Failed to load Qt translation for" << newLanguage.name;
         return false;
      }

      qApp->installTranslator(t.data());
      mLangIdToQtTranslator.insert(newLanguageId, t.take());
   }
   if( mLangIdToTranslator.contains(newLanguageId) )
      qApp->installTranslator(mLangIdToTranslator.value(newLanguageId, NULL));
   else // try to load from disk
   {
      QScopedPointer<QTranslator> t(new QTranslator);
      const bool loadedApp =
         t->load(QString("qswallet_%1.qm").arg(newLanguage.shortName),
         appDir);
      if( !loadedApp )
      {
         QLOG_WARN() << "Failed to load app translation for" << newLanguage.name;
         return false;
      }
      qApp->installTranslator(t.data());
      mLangIdToTranslator.insert(newLanguageId, t.take());
   }

   mApplicationLanguage = newLanguageId;
   return true;
}
开发者ID:nash142857,项目名称:brain_cal_server,代码行数:60,代码来源:QsLanguage.cpp


示例6: QLOG_WARN

void Shop::SubmitShopToForum(bool force) {
    if (submitting_) {
        QLOG_WARN() << "Already submitting your shop.";
        return;
    }
    if (threads_.empty()) {
        QLOG_ERROR() << "Asked to update a shop with no shop ID defined.";
        return;
    }

    if (shop_data_outdated_)
        Update();

    std::string previous_hash = app_.data().Get("shop_hash");
    // Don't update the shop if it hasn't changed
    if (previous_hash == shop_hash_ && !force)
        return;

    if (threads_.size() < shop_data_.size()) {
        QLOG_WARN() << "Need" << shop_data_.size() - threads_.size() << "more shops defined to fit all your items.";
    }

    requests_completed_ = 0;
    submitting_ = true;
    SubmitSingleShop();
}
开发者ID:LabaPoOs,项目名称:Acquisition,代码行数:26,代码来源:shop.cpp


示例7: shader

unsigned ShaderLibrary::loadShader(QString const& path, unsigned const mode)
{
   unsigned shader(0);
   QFile file(path);

   if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
      QString contents(file.readAll()); 
      file.close();

      QByteArray raw(contents.toLocal8Bit());
      const char* c_str(raw.data());

      shader = glCreateShader(mode);
      glShaderSource(shader, 1, &c_str, NULL);
      glCompileShader(shader);

      // Check if things compiled okay
      unsigned buflen(1000);
      GLsizei msgLength;
      char msg[buflen];
      glGetShaderInfoLog(shader, buflen, &msgLength, msg);

      if (msgLength != 0) {
         QLOG_WARN() << "Failed to compile shader " << path;
         QLOG_WARN() << QString(msg);
         glDeleteShader(shader);  // required?
         shader = 0;
      }
   }

   return shader;
}
开发者ID:epifanovsky,项目名称:IQmol,代码行数:32,代码来源:ShaderLibrary.C


示例8: QLOG_ERROR

void M64BirDevice::getDeviceFrame()
{
    char buffer[1];         // buffer for the 'read command'
    m64_frame_t myFrame;    // storage structure, this should be an attribute of the
                            // class and not a local variable.
    int ret;                // nb of bytes written or read

    if( mDeviceHandle == NULL )
    {
        QLOG_ERROR() << "mDeviceHandle not defined";
        return;
    }

    //
    // Step 1 - send the 'read command'
    // Send 'read M64Bir Device opd values' command
    //
    buffer[0] = 'A';
    ret = usb_bulk_write( mDeviceHandle, M64_EP_OUT, buffer, 1, 1000);
    if( ret < 0 )
    {
        QLOG_WARN() << "Error writting: " << usb_strerror();
        return;
    }

    //
    // Step 2 - Read the data
    //
    ret = usb_bulk_read( mDeviceHandle, M64_EP_IN, (char *)&myFrame, sizeof(m64_frame_t), 1000);
    if( ret != sizeof(m64_frame_t) )
    {
        QLOG_WARN() << "ERROR: read" << ret << "bytes instead of" << sizeof(m64_frame_t);
    }

    if( ret < 0 )
    {
        QLOG_WARN() << "Error reading: " << usb_strerror();
        return;
    }

    //
    // Build OpenCV frame here
    //
    cv::Mat data( 16, 16, CV_16U );

    for(int i=0; i<16; i++)
    {
        for(int j=0; j<16; j++)
        {
            data.at< unsigned short int >( i, j ) = myFrame.img[ i*16 + j ];
        }
    }

    emit newFrame( data );

}
开发者ID:isorg,项目名称:MagicPad,代码行数:56,代码来源:m64BirDevice.cpp


示例9: QLOG_WARN

std::string BuyoutManager::Serialize(const std::map<std::string, Buyout> &buyouts) {
    rapidjson::Document doc;
    doc.SetObject();
    auto &alloc = doc.GetAllocator();

    for (auto &bo : buyouts) {
        const Buyout &buyout = bo.second;
        if (buyout.type != BUYOUT_TYPE_NO_PRICE && (buyout.currency == CURRENCY_NONE || buyout.type == BUYOUT_TYPE_NONE))
            continue;
        if (buyout.type >= BuyoutTypeAsTag.size() || buyout.currency >= CurrencyAsTag.size()) {
            QLOG_WARN() << "Ignoring invalid buyout, type:" << buyout.type
                << "currency:" << buyout.currency;
            continue;
        }
        rapidjson::Value item(rapidjson::kObjectType);
        item.AddMember("value", buyout.value, alloc);

        if (!buyout.last_update.isNull()){
            item.AddMember("last_update", buyout.last_update.toTime_t(), alloc);
        }else{
            // If last_update is null, set as the actual time
            item.AddMember("last_update", QDateTime::currentDateTime().toTime_t(), alloc);
        }

        Util::RapidjsonAddConstString(&item, "type", BuyoutTypeAsTag[buyout.type], alloc);
        Util::RapidjsonAddConstString(&item, "currency", CurrencyAsTag[buyout.currency], alloc);

        rapidjson::Value name(bo.first.c_str(), alloc);
        doc.AddMember(name, item, alloc);
    }

    return Util::RapidjsonSerialize(doc);
}
开发者ID:melpheos,项目名称:acquisition,代码行数:33,代码来源:buyoutmanager.cpp


示例10: fp

bool HelperLaunchd::writePlist()
{
    QVariantMap launchPlist;

    launchPlist.insert("Label", "tv.plex.player");
    launchPlist.insert("RunAtLoad", true);

    QVariantMap keepAlive;
    keepAlive.insert("SuccessfulExit", false);
    launchPlist.insert("KeepAlive", keepAlive);

    launchPlist.insert("ProcessType", "Background");
    launchPlist.insert("Program", HelperLauncher::HelperPath());

    PListSerializer plistOut;
    QString output = plistOut.toPList(launchPlist);

    if (!output.isEmpty())
    {
        QFile fp(launchPlistPath());
        if (fp.open(QIODevice::WriteOnly | QIODevice::Truncate))
        {
            fp.write(output.toUtf8());
        }
        else
        {
            QLOG_WARN() << "Failed to write launchd plist file:" << launchPlistPath();
            return false;
        }
    }

    return false;
}
开发者ID:plexinc,项目名称:plex-media-player,代码行数:33,代码来源:HelperLaunchd.cpp


示例11: switch

int InputCEC::CecLogMessage(void* cbParam, const cec_log_message message)
{
    InputCEC *cec = (InputCEC*)cbParam;
    switch (message.level)
    {
    case CEC_LOG_ERROR:
        QLOG_ERROR() << "libCEC ERROR:" << message.message;
        break;

    case CEC_LOG_WARNING:
        QLOG_WARN() << "libCEC WARNING:" << message.message;
        break;

    case CEC_LOG_NOTICE:
        QLOG_INFO() << "libCEC NOTICE:" << message.message;
        break;

    case CEC_LOG_DEBUG:
        if (cec->m_verboseLogging)
        {
            QLOG_DEBUG() << "libCEC DEBUG:" << message.message;
        }
        break;

    case CEC_LOG_TRAFFIC:
        break;

    default:
        break;
    }

    return 0;
}
开发者ID:norbusan,项目名称:plex-media-player,代码行数:33,代码来源:InputCEC.cpp


示例12: QLOG_WARN

void ItemsManagerWorker::Update(TabCache::Policy policy, const std::vector<ItemLocation> &tab_names) {
    if (updating_) {
        QLOG_WARN() << "ItemsManagerWorker::Update called while updating";
        return;
    }

    if (policy == TabCache::ManualCache) {
        for (auto const &tab: tab_names)
            tab_cache_->AddManualRefresh(tab);
    }

    tab_cache_->OnPolicyUpdate(policy);

    QLOG_DEBUG() << "Updating stash tabs";
    updating_ = true;
    // remove all mappings (from previous requests)
    if (signal_mapper_)
        delete signal_mapper_;
    signal_mapper_ = new QSignalMapper;
    // remove all pending requests
    queue_ = std::queue<ItemsRequest>();
    queue_id_ = 0;
    replies_.clear();
    items_.clear();
    tabs_as_string_ = "";
    selected_character_ = "";

    // first, download the main page because it's the only way to know which character is selected
    QNetworkReply *main_page = network_manager_.get(Request(QUrl(kMainPage), ItemLocation(), TabCache::Refresh));
    connect(main_page, &QNetworkReply::finished, this, &ItemsManagerWorker::OnMainPageReceived);
}
开发者ID:Gloorf,项目名称:acquisition,代码行数:31,代码来源:itemsmanagerworker.cpp


示例13: messageHandler

void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
	(void)context;
	QDateTime now = QDateTime::currentDateTime();
	QDate nowDate = now.date();
	QTime nowTime = now.time();
	QByteArray localMsg = msg.toLocal8Bit();
    switch (type)
	{
		case QtDebugMsg:
		{
			QLOG_DEBUG() << localMsg.constData();
			break;
		}

		case QtWarningMsg:
		{
			QLOG_WARN() << localMsg.constData();
			break;
		}

		case QtCriticalMsg:
		{
			QLOG_ERROR() << localMsg.constData();
			break;
		}

		case QtFatalMsg:
		{
			QLOG_FATAL() << localMsg.constData();
			break;
		}
    }
}
开发者ID:samizzo,项目名称:canon-tweet,代码行数:34,代码来源:main.cpp


示例14: removeAllPresets

void PresetManager::readPresetFile()
{
    // first remove all loaded presets
    removeAllPresets();
    QSettings presets(m_presetFile.absoluteFilePath(), QSettings::IniFormat);
    presets.beginGroup("GRAPHING_PRESETS");

    if(presets.contains(("PRESET_FILE_VERSION")))
    {
        QString presetVersion = presets.value("PRESET_FILE_VERSION").toString();

        if(presetVersion == "1.0")
        {
            readPresetFileVersion10(presets);
        }
        // Add new preset versions here!
        else
        {
            QLOG_ERROR() << "Could not load preset file " << m_presetFile.absoluteFilePath() << ". Unknown Version:" << presetVersion;
            m_presetFile = QFileInfo();
        }
    }
    else
    {
        QLOG_WARN() << "PresetManager::readPresetFile() - ini file has no version string - not loaded";
        m_presetFile = QFileInfo();
    }

    presets.endGroup(); // "GRAPHING_PRESETS"

    m_presetHasChanged = false;    // a fresh loaded preset has not changed
    adaptWindowTitle();
}
开发者ID:AndKe,项目名称:apm_planner,代码行数:33,代码来源:PresetManager.cpp


示例15: path

bool OcDbManager::openDB()
{
    db = QSqlDatabase::addDatabase("QSQLITE");

    QString path(QDir::homePath());
    path.append(BASE_PATH).append("/database.sqlite");
    path = QDir::toNativeSeparators(path);

    QLOG_DEBUG() << "Database file path: " << path;

    // check if database file exists before database will be opened
    QFile dbfile(path);

    while(!dbfile.exists()) {
        QLOG_WARN() << "Database file does not exist. Waiting for it's creation by the engine...";
        QEventLoop loop;
        QTimer::singleShot(1000, &loop, SLOT(quit()));
        loop.exec();
    }

    db.setDatabaseName(path);
    db.setConnectOptions("QSQLITE_OPEN_READONLY");

    bool dbOpen = db.open();

    if (!dbOpen) {
        QLOG_FATAL() << "Can not open sqlite database";
    } else {
        QLOG_INFO() << "Opened sqlite database";
    }

    return dbOpen;
}
开发者ID:Buschtrommel,项目名称:ocNews,代码行数:33,代码来源:ocdbmanager.cpp


示例16: QLOG_WARN

std::string BuyoutManager::Serialize(const QMap<QString, Buyout> &buyouts) {
    QJsonDocument doc;
    QJsonObject root;
    for (QString hash : buyouts.uniqueKeys()) {
        Buyout buyout = buyouts.value(hash);
        if (buyout.type != BUYOUT_TYPE_NO_PRICE && (buyout.currency == CURRENCY_NONE || buyout.type == BUYOUT_TYPE_NONE))
            continue;
        if (buyout.type >= BuyoutTypeAsTag.size() || buyout.currency >= CurrencyAsTag.size()) {
            QLOG_WARN() << "Ignoring invalid buyout, type:" << buyout.type
                << "currency:" << buyout.currency;
            continue;
        }
        QJsonObject value;
        value.insert("value", buyout.value);
        value.insert("set_by", buyout.set_by);

        if (!buyout.last_update.isNull()){
            value.insert("last_update", (int) buyout.last_update.toTime_t());
        } else {
            // If last_update is null, set as the actual time
            value.insert("last_update", (int) QDateTime::currentDateTime().toTime_t());
        }

        value.insert("type", QString::fromStdString(BuyoutTypeAsTag[buyout.type]));
        value.insert("currency", QString::fromStdString(CurrencyAsTag[buyout.currency]));

        root.insert(hash, value);
    }
    doc.setObject(root);
    QByteArray result = doc.toJson();
    return result.toStdString();
}
开发者ID:anbabane,项目名称:acquisitionplus,代码行数:32,代码来源:buyoutmanager.cpp


示例17: QLOG_WARN

bool InputComponent::addInput(InputBase* base)
{
  if (!base->initInput())
  {
    QLOG_WARN() << "Failed to init input:" << base->inputName();
    return false;
  }
  
  QLOG_INFO() << "Successfully inited input:" << base->inputName();
  m_inputs.push_back(base);

  // we connect to the provider receivedInput signal, then we check if the name
  // needs to be remaped in remapInput and then finally send it out to JS land.
  //
  connect(base, &InputBase::receivedInput, this, &InputComponent::remapInput);


  // for auto-repeating inputs
  //
  m_autoRepeatTimer = new QTimer(this);
  connect(m_autoRepeatTimer, &QTimer::timeout, [=]()
  {
    if (!m_currentAction.isEmpty())
    {
      m_currentActionCount ++;
      emit receivedAction(m_currentAction);
    }

    qint32 multiplier = qMin(5, qMax(1, m_currentActionCount / 5));
    m_autoRepeatTimer->setInterval(100 / multiplier);
  });

  return true;
}
开发者ID:imbavirus,项目名称:plex-media-player,代码行数:34,代码来源:InputComponent.cpp


示例18: QLOG_TRACE

void ThreadHandler::restoreThreads() {
    int threadCount;

    out << "Reopening threads\n";

    threadCount = settings->value("tabs/count",0).toInt();
    QLOG_TRACE() << "ThreadHandler :: restoring Threads";

    ImageThread* it;

    if (threadCount > 0) {
        for (int i=0; i<threadCount; i++) {
            it = addThread();

            it->setValues(
                settings->value(QString("tabs/tab%1").arg(i), ";;;;0;;every 30 seconds;;0").toString()
            );
            out << " opening " << it->getUrl() << "\n";
        }
    }
    else {
        QLOG_WARN() << "ThreadHandler :: No threads available to restore";
        emit threadListEmpty();
    }
    out.flush();
}
开发者ID:ycaihua,项目名称:fourchan,代码行数:26,代码来源:threadhandler.cpp


示例19: list

bool QueueResources::fromQVariant(QVariant const& qvar)
{
   QVariantList list(qvar.toList());

   if (list.size() != 12) {
      QLOG_WARN() << "Invalid resource list passed to QueueResources::fromQVariant()";
      return false;
   }

   bool allOk(true), ok(true);

   m_name            = list.at( 0).toString();
   m_maxWallTime     = list.at( 1).toString();
   m_defaultWallTime = list.at( 2).toString();
   m_maxMemory       = list.at( 3).toInt(&ok);     allOk = allOk && ok;
   m_minMemory       = list.at( 4).toInt(&ok);     allOk = allOk && ok;
   m_defaultMemory   = list.at( 5).toInt(&ok);     allOk = allOk && ok;
   m_maxScratch      = list.at( 6).toInt(&ok);     allOk = allOk && ok;
   m_minScratch      = list.at( 7).toInt(&ok);     allOk = allOk && ok;
   m_defaultScratch  = list.at( 8).toInt(&ok);     allOk = allOk && ok;
   m_maxCpus         = list.at( 9).toInt(&ok);     allOk = allOk && ok;
   m_minCpus         = list.at(10).toInt(&ok);     allOk = allOk && ok;
   m_defaultCpus     = list.at(11).toInt(&ok);     allOk = allOk && ok;

   return allOk;
}
开发者ID:autodataming,项目名称:IQmol,代码行数:26,代码来源:QueueResources.C


示例20: main

int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);

   // init the logging mechanism
   QsLogging::Logger& logger = QsLogging::Logger::instance();
   logger.setLoggingLevel(QsLogging::TraceLevel);
   const QString sLogPath(QDir(a.applicationDirPath()).filePath("log.txt"));
   QsLogging::DestinationPtr fileDestination(
      QsLogging::DestinationFactory::MakeFileDestination(sLogPath) );
   QsLogging::DestinationPtr debugDestination(
      QsLogging::DestinationFactory::MakeDebugOutputDestination() );
   logger.addDestination(debugDestination.get());
   logger.addDestination(fileDestination.get());
   //logger.setLoggingLevel(QsLogging::InfoLevel);

   QLOG_INFO() << "Program started";
   QLOG_INFO() << "Built with Qt" << QT_VERSION_STR << "running on" << qVersion();

   QLOG_TRACE() << "Here's a" << QString("trace") << "message";
   QLOG_DEBUG() << "Here's a" << static_cast<int>(QsLogging::DebugLevel) << "message";
   QLOG_WARN()  << "Uh-oh!";
   qDebug() << "This message won't be picked up by the logger";
   QLOG_ERROR() << "An error has occurred";
   qWarning() << "Neither will this one";
   QLOG_FATAL() << "Fatal error!";

   const int ret = 0;
   std::cout << std::endl << "Press any key...";
   std::cin.get();
   QLOG_INFO() << "Program exited with return code" << ret;
   return ret;
}
开发者ID:Mik42l,项目名称:MagicPad_v2_src,代码行数:33,代码来源:main.cpp



注:本文中的QLOG_WARN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QL_FAIL函数代码示例发布时间:2022-05-30
下一篇:
C++ QLOG_INFO函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap