本文整理汇总了C++中LOG_FATAL函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_FATAL函数的具体用法?C++ LOG_FATAL怎么用?C++ LOG_FATAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOG_FATAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: pidfile_create
int pidfile_create()
{
if (arg_pid)
{
FILE* pidfile = fopen(arg_pid, "w");
if (!pidfile)
{
LOG_FATAL("Unable to write pid file: %s\n", arg_pid);
return -1;
}
fprintf(pidfile, "%d", (int) getpid());
fclose(pidfile);
}
return 0;
}
开发者ID:CoiLock,项目名称:uhub,代码行数:16,代码来源:main.c
示例17: lock
void ThreadRunner::run()
{
// this is the body of execution of separate thread
boost::mutex::scoped_lock lock(m_runmutex);
try{
workerThrew=false;
while(looping()) {
call();
if(m_thread_worker->shouldTerminate()){ stop(); return; }
}
} catch (std::exception& e){
LOG_FATAL("Exception occured: "<<std::endl<<e.what());
workerException=std::exception(e); workerThrew=true;
stop(); return;
}
}
开发者ID:cosurgi,项目名称:trunk,代码行数:16,代码来源:ThreadRunner.cpp
示例18: LOG_FATAL
static struct register_set *ra_get_register_set(struct ra *ra,
enum ir_type type) {
if (is_is_int(type)) {
return &ra->int_registers;
}
if (ir_is_float(type)) {
return &ra->float_registers;
}
if (ir_is_vector(type)) {
return &ra->vector_registers;
}
LOG_FATAL("Unexpected value type");
}
开发者ID:ST3ALth,项目名称:redream,代码行数:16,代码来源:register_allocation_pass.c
示例19: system_init
INIT static void system_init()
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = fatal_error_signal;
if (sigaction(SIGSEGV, &sa, NULL) ||
sigaction(SIGILL, &sa, NULL) ||
sigaction(SIGFPE, &sa, NULL) ||
sigaction(SIGABRT, &sa, NULL)) {
LOG_FATAL(core, "%s", errno_error(errno));
abort();
}
}
开发者ID:Cyber-Forensic,项目名称:haka,代码行数:16,代码来源:system.c
示例20: handle_message
static void handle_message(message_t *message, void *d)
{
driver_console_t *driver = (driver_console_t*) d;
switch(message->type)
{
case MESSAGE_DATA_IN:
if(message->message.data_in.session_id == driver->session_id)
handle_data_in(driver, message->message.data_in.data, message->message.data_in.length);
break;
default:
LOG_FATAL("driver_console received an invalid message: %d", message->type);
abort();
}
}
开发者ID:atimorin,项目名称:dnscat2,代码行数:16,代码来源:driver_console.c
注:本文中的LOG_FATAL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论