本文整理汇总了C++中LOG_W函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_W函数的具体用法?C++ LOG_W怎么用?C++ LOG_W使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOG_W函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __ldh_src_open
static __inline__ int32_t
__ldh_src_open(ldh_src *ldh, media_uri *mrl)
{
int32_t err = -EPERM, ch, level, type;
uint8_t prop[PROPERTY_BUF_LEN], start_time[TIME_BUF_LEN],end_time[TIME_BUF_LEN];
if (!hso || !hso->open)
return err;
err = __parse_mrl(mrl, &ch, &level, &type, start_time,
end_time, prop, NULL);
if (err)
{
LOG_W(
"__ldh_src_open()->__parse_mrl(%s) failed, err:'%d'.",
__str(mrl), err
);
return err;
}
err = (*hso->open)((avs_media*)ldh, ch, level, type,
start_time, end_time, prop);
if (err)
{
LOG_W(
"__ldh_src_open()->(*hso->open)(%s) failed, err:'%d'.",
__str(mrl), err
);
return err;
}
ldh->state = OPENED;
return 0;
}
示例2: files_init
bool files_init(honggfuzz_t * hfuzz)
{
hfuzz->files = util_Malloc(sizeof(char *));
hfuzz->files[0] = "NONE";
hfuzz->fileCnt = 1;
if (hfuzz->externalCommand) {
LOG_I
("No input file corpus loaded, the external command '%s' is responsible for creating the fuzz files",
hfuzz->externalCommand);
return true;
}
if (!hfuzz->inputDir) {
LOG_W("No input file/dir specified");
return false;
}
struct stat st;
if (stat(hfuzz->inputDir, &st) == -1) {
PLOG_W("Couldn't stat the input dir '%s'", hfuzz->inputDir);
return false;
}
if (S_ISDIR(st.st_mode)) {
return files_readdir(hfuzz);
}
LOG_W("The initial corpus directory '%s' is not a directory", hfuzz->inputDir);
return false;
}
示例3: create_local_media_src
static media_src *
create_local_media_src(tr_factory *tr_f, int32_t m_type)
{
ld_src *src;
if (m_type == 0)
{
src = (ld_src*)ldl_src_alloc(NULL);
if (!src)
{
LOG_W("Create local hitory media src failed.");
}
}
else
{
src = (ld_src*)ldh_src_alloc(NULL);
if (!src)
{
LOG_W("Create local hitory media src failed.");
}
else
{
if (m_type == MS_DOWNLD)
{
ldh_src_set_download_mode((ldh_src*)src);
}
}
}
return (media_src*)src;
}
示例4: rtsp_method_do_desc
static __inline__ void
rtsp_method_do_desc(rtsp_client *rc, rtsp_message *req, media *media)
{
RTSP_STATUS_CODE rsc;
rtsp_message *res;
int32_t err, sdp_size;
media_info mi;
sdp_message *sdp = NULL;
char *content_base = NULL;
uint8_t *sdp_buf;
uint32_t cb_size;
err = media_info_get(media, &mi);
if (!err)
{
content_base = rtsp_method_get_content_base(req, &cb_size);
if (!content_base)
{
LOG_W(
"rtsp_method_do_desc()->rtsp_method_get_content_base() failed."
);
err = -EINVAL;
goto desc_err;
}
sdp = rtsp_method_mi_to_sdp(&mi);
sdp_buf = (uint8_t*)rtsp_mem_alloc(MAX_RTSP_BUF_SIZE);
sdp_size = sdp_message_as_text(sdp, (char*)sdp_buf, MAX_RTSP_BUF_SIZE);
sdp_message_free(sdp);
if (sdp_size < 0 || sdp_size >= MAX_RTSP_BUF_SIZE)
{
LOG_W(
"rtsp_method_do_desc()->sdp_message_as_text() failed."
);
tr_free(content_base, cb_size);
err = -EINVAL;
goto desc_err;
}
media_info_clear(&mi);
res = rtsp_impl_new_generic_response(req, RTSP_STS_OK);
rtsp_message_take_body(res, sdp_buf, sdp_size);
rtsp_message_add_header(res, RTSP_HDR_CONTENT_TYPE, "application/sdp");
rtsp_message_add_header(res, RTSP_HDR_CONTENT_BASE, content_base);
tr_free(content_base, cb_size);
rtsp_impl_send_message(rc, res);
return;
}
desc_err:
media_info_clear(&mi);
rsc = rtsp_impl_trans_status_code(TR_RTSP_DESC, err);
res = rtsp_impl_new_generic_response(req, rsc);
rtsp_impl_send_message(rc, res);
}
示例5: __ldh_src_read_ahead
static __inline__ void
__ldh_src_read_ahead(ldh_src *ldh)
{
int32_t err, vfrm_count = 0;
frame_t *frm;
if (!hso || !hso->pull)
{
LOG_W(
"__ldh_src_read_ahead()->hso->pull is NULL."
);
return;
}
for (;;)
{
if (ldh->state != PLAYED || (ldh->flags & LDH_FLGS_EOF))
break;
if (ldh->frm_count >= MAX_CACHED)
break;
if (vfrm_count >= PREREAD_BATCH)
break;
frm = NULL;
err = (*hso->pull)((avs_media*)ldh, &frm);
if (err)
{
LOG_W(
"__ldh_src_read_ahead()->(*hso->pull) failed, err:'%d'",
err
);
return;
}
if (frm)
{
ldh_fill_frm(ldh, frm);
if (IS_VIDEO_FRAME(frm))
{
++vfrm_count;
}
}
else
{
LOG_W(
"__ldh_src_read_ahead()->(*hso->pull) got 'NULL' frame"
);
}
}
ldh->flags &= ~LDH_FLGS_READING;
}
示例6: short
/*
This function is still a proof of concept, it's probably rife with bugs, below
is a short (and incomplete) todo
* "Basic" checks (Read/Write/File/Dir) checks for FAT32 filesystems which
requires detecting the filesystem being used.
*/
void Check(fs::path const& file, acs::Type type) {
DWORD file_attr = GetFileAttributes(file.c_str());
if ((file_attr & INVALID_FILE_ATTRIBUTES) == INVALID_FILE_ATTRIBUTES) {
switch (GetLastError()) {
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
throw fs::FileNotFound(file);
case ERROR_ACCESS_DENIED:
throw fs::ReadDenied(file);
default:
throw fs::FileSystemUnknownError(str(boost::format("Unexpected error when getting attributes for \"%s\": %s") % file % util::ErrorString(GetLastError())));
}
}
switch (type) {
case FileRead:
case FileWrite:
if ((file_attr & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
throw fs::NotAFile(file);
break;
case DirRead:
case DirWrite:
if ((file_attr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY)
throw fs::NotADirectory(file);
break;
}
SECURITY_INFORMATION info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
DWORD len = 0;
GetFileSecurity(file.c_str(), info, nullptr, 0, &len);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
LOG_W("acs/check") << "GetFileSecurity: fatal: " << util::ErrorString(GetLastError());
std::vector<uint8_t> sd_buff(len);
SECURITY_DESCRIPTOR *sd = (SECURITY_DESCRIPTOR *)&sd_buff[0];
if (!GetFileSecurity(file.c_str(), info, sd, len, &len))
LOG_W("acs/check") << "GetFileSecurity failed: " << util::ErrorString(GetLastError());
ImpersonateSelf(SecurityImpersonation);
HANDLE client_token;
if (!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &client_token))
LOG_W("acs/check") << "OpenThreadToken failed: " << util::ErrorString(GetLastError());
if (!check_permission(true, sd, client_token))
throw fs::ReadDenied(file);
if ((type == DirWrite || type == FileWrite) && !check_permission(false, sd, client_token))
throw fs::WriteDenied(file);
}
示例7: get_all_files
int get_all_files(PHandleFunc func, void* func_args)
{
int ret = 0;
if (!func) {
LOG_E("func is null\n");
ret = -1;
goto out;
}
GPParams gp_params = {0};
gp_params_init (&gp_params, NULL);
if ( (ret = cam_detect_camera(&gp_params)) < 0)
goto err_cam_detect;
if (ret == 0)
goto no_camera_detect;
struct FuncArgu args = {func, func_args};
get_file_recursive("/", &gp_params, &args);
release_param:
gp_params_exit(&gp_params);
out:
return ret;
no_camera_detect:
LOG_W("no camera detected\n");
goto release_param;
err_cam_detect:
ret = -1;
goto release_param;
}
示例8: LOG_W
void ImOnlineAdapterServiceProxy::offline(long userId,bool isDelLongOnline){
LOG_W(userId, "ImOnlineAdapterServiceProxy::offline", -1, "");
#ifndef INTERNATIONAL
ReadLock lock(mutex_);
ImOnlineAdapterServicePrx proxy = getProxy(userId);//取ImOnlineAdapterService的代理
if(!proxy){
LOG_ERROR("ImOnlineAdapterServiceProxy::offline => get proxy failure : userId = " << userId << " isDelLongOnline=" << isDelLongOnline);
return;
}
LOG_DEBUG("ImOnlineAdapterServiceProxy::offline <<userId = " << userId << " isDelLongOnline=" << isDelLongOnline<< " getProxy success.");
try{
proxy->offline(userId,isDelLongOnline);
} catch (exception& e){
LOG_ERROR("ImOnlineAdapterServiceProxy::offline => failure : proxy = " << proxy->ice_toString() << " exception = " << e.what());
return;
}catch(...){
LOG_ERROR("ImOnlineAdapterServiceProxy::offline => failure : proxy = " << proxy->ice_toString() << " exception = unknow exception" );
return;
}
LOG_DEBUG("ImOnlineAdapterServiceProxy::offline => userId = " << userId << " isDelLongOnline=" << isDelLongOnline << " interface function call success");
#endif
return;
}
示例9: gtpv1u_initial_req
//-----------------------------------------------------------------------------
int
gtpv1u_initial_req(
gtpv1u_data_t *gtpv1u_data_pP,
teid_t teidP,
tcp_udp_port_t portP,
uint32_t address)
{
NwGtpv1uUlpApiT ulp_req;
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
memset(&ulp_req, 0, sizeof(NwGtpv1uUlpApiT));
ulp_req.apiType = NW_GTPV1U_ULP_API_INITIAL_REQ;
ulp_req.apiInfo.initialReqInfo.teid = teidP;
ulp_req.apiInfo.initialReqInfo.peerPort = portP;
ulp_req.apiInfo.initialReqInfo.peerIp = address;
rc = nwGtpv1uProcessUlpReq(gtpv1u_data_pP->gtpv1u_stack, &ulp_req);
if (rc == NW_GTPV1U_OK) {
LOG_D(GTPU, "Successfully sent initial req for teid %u\n", teidP);
} else {
LOG_W(GTPU, "Could not send initial req for teid %u\n", teidP);
}
return (rc == NW_GTPV1U_OK) ? 0 : -1;
}
示例10: util_print_hex_octets
/*
* Prints incoming byte stream in hexadecimal and readable form
*
* @param component Utilised as with macros defined in UTIL/LOG/log.h
* @param data unsigned char* pointer for data buffer
* @param size Number of octets in data buffer
* @return none
*/
void util_print_hex_octets(comp_name_t component, unsigned char* data, unsigned long size)
{
if (data == NULL) {
LOG_W(component, "Incoming buffer is NULL! Ignoring...\n");
return;
}
unsigned long octet_index = 0;
LOG_D(component, " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
LOG_D(component, "-----+-------------------------------------------------|\n");
LOG_T(component, " 000 |");
for (octet_index = 0; octet_index < size; ++octet_index) {
/*
* Print every single octet in hexadecimal form
*/
LOG_T(component, " %02x", data[octet_index]);
/*
* Align newline and pipes according to the octets in groups of 2
*/
if (octet_index != 0 && (octet_index + 1) % 16 == 0) {
LOG_T(component, " |\n");
LOG_T(component, " %03d |", octet_index);
}
}
/*
* Append enough spaces and put final pipe
*/
unsigned char index;
for (index = octet_index; index < 16; ++index)
LOG_T(component, " ");
LOG_T(component, " |\n");
}
示例11: LOG_W
int Application::startup()
{
// Already initialised!
if(initialised)
{
LOG_W("Application startup", "Application already loaded!");
return EXIT_SUCCESS;
}
// Set up SDL (create window and context for OpenGL)
ASSERT(startSDL() == EXIT_SUCCESS, "Starting SDL");
// Set up OpenGL/GLES "propre"
ASSERT(startGL() == EXIT_SUCCESS, "Starting OpenGL/GLES");
// Start up resource subsystems
ASSERT(GraphicsManager::getInstance()->startup()
== EXIT_SUCCESS, "Starting Graphics Manager");
// Start the Audio Manager
ASSERT(AudioManager::getInstance()->startup()
== EXIT_SUCCESS, "Starting Audio Manager");
// Start the Font Manager
ASSERT(FontManager::getInstance()->startup()
== EXIT_SUCCESS, "Starting Font Manager");
// Load the initial scene
ASSERT(scene->startup() == EXIT_SUCCESS, "Loading initial Scene");
// Initialisation successful!
initialised = true;
return EXIT_SUCCESS;
}
示例12: __ldl_src_play
static int32_t
__ldl_src_play(ldl_src *ldl)
{
int32_t err = -EPERM;
if (!lso || !lso->play)
return err;
if (ldl->state != OPENED)
return err;
LOG_I(
"__ldl_src_play(): avs_media '%p'.", ldl
);
err = (*lso->play)((avs_media*)ldl);
if (err)
{
LOG_W(
"__ldl_src_play()->(*lso->play)() failed, err:'%d'.",
err
);
return err;
}
else
{
LOG_I(
"__ldl_src_play(): avs_media '%p' ok.", ldl
);
}
return 0;
}
示例13: __ldl_src_ctrl
static int32_t
__ldl_src_ctrl(ldl_src *ldl, int32_t cmd, void *data)
{
int32_t err = -EPERM;
if (!lso || !lso->ctrl)
return err;
if (ldl->state != OPENED)
return err;
LOG_I(
"__ldl_src_ctrl(): avs_media '%p'", ldl
);
err = (*lso->ctrl)((avs_media*)ldl, cmd, data);
if (err)
{
LOG_W(
"__ldl_src_ctrl()->(*lso->ctrl)() failed, err:'%d'.",
err
);
return err;
}
else
{
LOG_I(
"__ldl_src_ctrl(): avs_media '%p' ok.", ldl
);
}
return 0;
}
示例14: __ldh_src_pause
static int32_t
__ldh_src_pause(ldh_src *ldh)
{
int32_t err;
if (ldh->state == OPENED || ldh->state == PLAYED)
{
if (!hso || !hso->pause)
{
ldh->state = PAUSED;
return 0;
}
err = (*hso->pause)((avs_media*)ldh);
if (err)
{
LOG_W(
"__ldh_src_pause()->(*hso->pause)() failed, err:'%d'.",
err
);
}
else
{
ldh->state = PAUSED;
}
return err;
}
return 0;
}
示例15: __ldh_src_play
static __inline__ int32_t
__ldh_src_play(ldh_src *ldh)
{
int32_t err;
if (ldh->state == CLOSED || ldh->state == PLAYED)
return -EINVAL;
if (!hso || !hso->play)
{
ldh->state = PLAYED;
return 0;
}
err = (*hso->play)((avs_media*)ldh);
if (err)
{
LOG_W(
"__ldh_src_play()->(*hso->play)() failed, err:'%d'.",
err
);
return err;
}
ldh->state = PLAYED;
return 0;
}