当前位置: 首页>>代码示例>>C++>>正文


C++ LOG_FATAL函数代码示例

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


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

示例1: mysql_real_connect

int MySQLConn::connect() {
    MYSQL* result =
        mysql_real_connect(conn_,
                           option_.host.c_str(),
                           option_.user.c_str(),
                           option_.passwd.c_str(),
                           option_.database.c_str(),
                           option_.port,
                           nullptr,
                           0);
    if (!result) {
        LOG_FATAL("event=[connectmysqlfailed] type=[connect]");
        return Status::FAILED;
    }

    int ret = mysql_set_character_set(conn_, "utf8");
    if (ret) {
        LOG_FATAL("connect mysql failed type=[setcharset]");
        return Status::FAILED;
    }
    LOG_INFO("connected to mysql host=[%s:%d]",
        option_.host.c_str(), option_.port);
    return Status::OK;
}
开发者ID:gityf,项目名称:db,代码行数:24,代码来源:MySQLConn.cpp

示例2: LOG_INFO

void
Backup::figure_out_start_snapshot()
{
    LOG_INFO(__FUNCTION__);
    VERIFY(source_snapshot_persistor);

    start_snapshot_ = source_ptree.get_optional<SnapshotName>("start_snapshot");

    if(start_snapshot_ and
       not source_snapshot_persistor->snapshotExists(*start_snapshot_))
    {
        LOG_FATAL("Could not find start snapshot " << *start_snapshot_ << " in source");
        throw BackupException("Could not find snapshot");
    }
}
开发者ID:DarumasLegs,项目名称:volumedriver,代码行数:15,代码来源:Backup.cpp

示例3: shm_initialise

static int shm_initialise(RCL_Instance instance) {
  int id, param, perm;
  char *s;
  struct shmTime *shm;

  param = atoi(RCL_GetDriverParameter(instance));
  s = RCL_GetDriverOption(instance, "perm");
  perm = s ? strtol(s, NULL, 8) & 0777 : 0600;

  id = shmget(SHMKEY + param, sizeof (struct shmTime), IPC_CREAT | perm);
  if (id == -1) {
    LOG_FATAL(LOGF_Refclock, "shmget() failed");
    return 0;
  }
   
  shm = (struct shmTime *)shmat(id, 0, 0);
  if ((long)shm == -1) {
    LOG_FATAL(LOGF_Refclock, "shmat() failed");
    return 0;
  }

  RCL_SetDriverData(instance, shm);
  return 1;
}
开发者ID:SuperQ,项目名称:chrony,代码行数:24,代码来源:refclock_shm.c

示例4: throw

VOID Config::setScenarioFile(S8* filename) throw (ErrCodeEn)
{
   if (NULL == filename || STRLEN(filename) == 0)
   {
      LOG_FATAL("Invalid Scenario file");
      throw ERR_INV_CMD_LINE_PARAM;
   }
   
   if (0 == STRNCMP(filename, "--", 2))
   {
      throw ERR_INV_CMD_LINE_PARAM;
   }

   pCfg->scnFile.assign(filename);
}
开发者ID:2fumin,项目名称:LTE-GTP-Simulator,代码行数:15,代码来源:sim_cfg.cpp

示例5: DBLoadMimeInit

/**
 * \brief initialize
 */
int  DBLoadMimeInit()
{
  char *ErrorBuf;

  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);
  if (!pgConn)
  {
    LOG_FATAL("Unable to connect to database");
    exit(-1);
  }
  MagicCookie = magic_open(MAGIC_PRESERVE_ATIME|MAGIC_MIME);
  DBMime = NULL;

  return 0;
}
开发者ID:7hibault,项目名称:fossology,代码行数:18,代码来源:testDBLoadMime.c

示例6: switch

Vector3r Cell::pprevFluctVel(const Vector3r& currPos, const Vector3r& pprevVel, const Real& dt){
	switch(homoDeform){
		case HOMO_NONE:
		case HOMO_POS:
			return pprevVel;
		case HOMO_VEL:
		case HOMO_VEL_2ND:
			return (pprevVel-gradV*currPos);
		case HOMO_GRADV2:
			return pprevVel-gradV*(currPos-dt/2*pprevVel);
		default:
			LOG_FATAL("Cell::ptPprevFlutVel_pprev: invalid value of homoDeform");
			abort();
	};
}
开发者ID:Azeko2xo,项目名称:woodem,代码行数:15,代码来源:Cell.cpp

示例7: ir_zext_constant

uint64_t ir_zext_constant(const struct ir_value *v) {
  switch (v->type) {
    case VALUE_I8:
      return (uint8_t)v->i8;
    case VALUE_I16:
      return (uint16_t)v->i16;
    case VALUE_I32:
      return (uint32_t)v->i32;
    case VALUE_I64:
      return (uint64_t)v->i64;
    default:
      LOG_FATAL("Unexpected value type");
      break;
  }
}
开发者ID:ST3ALth,项目名称:redream,代码行数:15,代码来源:ir.c

示例8: packet_syn_set_download

void packet_syn_set_download(packet_t *packet, char *filename)
{
  if(packet->packet_type != PACKET_TYPE_SYN)
  {
    LOG_FATAL("Attempted to set the 'download' field of a non-SYN message\n");
    exit(1);
  }

  /* Free the name if it's already set */
  if(packet->body.syn.filename)
    safe_free(packet->body.syn.filename);

  packet->body.syn.options |= OPT_DOWNLOAD;
  packet->body.syn.filename = safe_strdup(filename);
}
开发者ID:EricSB,项目名称:dnscat2,代码行数:15,代码来源:packet.c

示例9: packet_syn_set_name

void packet_syn_set_name(packet_t *packet, char *name)
{
  if(packet->packet_type != PACKET_TYPE_SYN)
  {
    LOG_FATAL("Attempted to set the 'name' field of a non-SYN message\n");
    exit(1);
  }

  /* Free the name if it's already set */
  if(packet->body.syn.name)
    safe_free(packet->body.syn.name);

  packet->body.syn.options |= OPT_NAME;
  packet->body.syn.name = safe_strdup(name);
}
开发者ID:EricSB,项目名称:dnscat2,代码行数:15,代码来源:packet.c

示例10: handle_message

static void handle_message(message_t *message, void *d)
{
  driver_dns_t *driver_dns = (driver_dns_t*) d;

  switch(message->type)
  {
    case MESSAGE_PACKET_OUT:
      handle_packet_out(driver_dns, message->message.packet_out.data, message->message.packet_out.length);
      break;

    default:
      LOG_FATAL("driver_dns received an invalid message!");
      abort();
  }
}
开发者ID:atimorin,项目名称:dnscat2,代码行数:15,代码来源:driver_dns.c

示例11: DNS_Name2IPAddressAsync

void
DNS_Name2IPAddressAsync(const char *name, DNS_NameResolveHandler handler, void *anything)
{
  struct DNS_Async_Instance *inst;

  inst = MallocNew(struct DNS_Async_Instance);
  inst->name = name;
  inst->handler = handler;
  inst->arg = anything;
  inst->status = DNS_Failure;

  if (pipe(inst->pipe)) {
    LOG_FATAL(LOGF_Nameserv, "pipe() failed");
  }

  resolving_threads++;
  assert(resolving_threads <= 1);

  if (pthread_create(&inst->thread, NULL, start_resolving, inst)) {
    LOG_FATAL(LOGF_Nameserv, "pthread_create() failed");
  }

  SCH_AddFileHandler(inst->pipe[0], SCH_FILE_INPUT, end_resolving, inst);
}
开发者ID:pompomJuice,项目名称:chrony,代码行数:24,代码来源:nameserv_async.c

示例12: LOG_FATAL

QCheckBox* VOptionable::addCheckBox(QLayout* layout, QString objectName, QString text, bool value)
{
  QWidget* parentWidget = layout->parentWidget();
  if (parentWidget == NULL)
  {
    LOG_FATAL("parentWidget is null(%s)", qPrintable(objectName));
    return NULL;
  }
  if (parentWidget->findChild<QObject*>(objectName) != NULL)
  {
    LOG_FATAL("parentWidget->findChild(%s) is not null", qPrintable(objectName));
    return NULL;
  }

  QCheckBox* checkBox = new QCheckBox(parentWidget);

  checkBox->setObjectName(objectName);
  checkBox->setText(text);
  checkBox->setCheckState(value ? Qt::Checked : Qt::Unchecked);

  layout->addWidget(checkBox);

  return checkBox;
}
开发者ID:gilgil1973,项目名称:vdream90,代码行数:24,代码来源:vobjectwidget.cpp

示例13: check_cmd_user

static int check_cmd_user(const char* cmd, int status, struct linked_list* list, char* line, int line_count)
{
	char* data;
	char* data_extra;
	struct auth_info* info = 0;

	if (!strncmp(line, cmd, strlen(cmd)))
	{
		data = &line[strlen(cmd)];
		data_extra = 0;
		data[0] = '\0';
		data++;

		data = strip_white_space(data);
		if (!*data)
		{
			LOG_FATAL("ACL parse error on line %d", line_count);
			return -1;
		}

		info = hub_malloc_zero(sizeof(struct auth_info));

		if (!info)
		{
			LOG_ERROR("ACL parse error. Out of memory!");
			return -1;
		}

		if (strncmp(cmd, "user_", 5) == 0)
		{
			data_extra = strrchr(data, ':');
			if (data_extra)
			{
				data_extra[0] = 0;
				data_extra++;
			}
		}

		strncpy(info->nickname, data, MAX_NICK_LEN);
		if (data_extra)
			strncpy(info->password, data_extra, MAX_PASS_LEN);
		info->credentials = status;
		list_append(list, info);
		LOG_DEBUG("ACL: Added user '%s' (%s)", info->nickname, auth_cred_to_string(info->credentials));
		return 1;
	}
	return 0;
}
开发者ID:CoiLock,项目名称:uhub,代码行数:48,代码来源:auth.c

示例14: SBL_Execute

int SBL_Execute()
{
	int retVal = NPI_LNX_SUCCESS;

	LOG_INFO("[SBL] Executing Serial Bootloader\n");

	if (!sblImageBuf || (sblImageLen <= 0))
	{
		LOG_ERROR("[SBL] No binary file found\n");
		retVal = NPI_LNX_FAILURE;
	}
	else
	{
		int sbResult = 0;
		sblState = SBL_STATE_SERIAL_BOOT;
		sbResult = sbExec(sblImageBuf, sblImageLen);

		if (sbResult != 0)
		{
			npiMsgData_t pMsg;

			LOG_WARN("[SBL] Serial boot loader failed. Attempting hard reset\n");
			// Trying again after a hard reset

			pMsg.len = 0;
			pMsg.subSys = RPC_SYS_SRV_CTRL | RPC_CMD_AREQ;
			pMsg.cmdId = NPI_LNX_CMD_ID_RESET_DEVICE;
			// Send command
			NPI_SendAsynchData( &pMsg );

			// After a very short delay attempt again
			LOG_INFO("[SBL] Send Handshake command\n");

			retVal = BOOT_HandshakeReq();

			if (retVal != NPI_LNX_SUCCESS)
			{
				LOG_FATAL("[SBL] Serial boot loader failed. Please restart application.\n");
			}
			else
			{
				// Try again
				retVal = sbExec(sblImageBuf, sblImageLen);
			}
		}
	}
	return retVal;
}
开发者ID:TI-LPRF-Software,项目名称:RemoTI-Linux,代码行数:48,代码来源:sbl.c

示例15: run

	DWORD run()
	{
		DWORD exitCode;
		try 
		{
			exitCode = myRunnable->run();
		}
		catch(YCException& e)
		{
			LOG_FATAL("YCThread::run出现异常,线程退出:" << e.what());
			myRunnable->stop();
			//中断线程,退出
		}

		::ExitThread(exitCode);
	}
开发者ID:lovechen508,项目名称:GameClient,代码行数:16,代码来源:YCThread.cpp


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