mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 03:39:59 +00:00
Logging cleanups (#13370)
This commit is contained in:
parent
6ee92d8583
commit
8cc423e036
32
command.c
32
command.c
@ -223,7 +223,7 @@ command_t* command_network_new(uint16_t port)
|
||||
int fd = socket_init(
|
||||
(void**)&res, port, NULL, SOCKET_TYPE_DATAGRAM);
|
||||
|
||||
RARCH_LOG("%s %hu.\n",
|
||||
RARCH_LOG("[NetCMD]: %s %hu.\n",
|
||||
msg_hash_to_str(MSG_BRINGING_UP_COMMAND_INTERFACE_ON_PORT),
|
||||
(unsigned short)port);
|
||||
|
||||
@ -241,7 +241,7 @@ command_t* command_network_new(uint16_t port)
|
||||
|
||||
if (!socket_bind(netcmd->net_fd, (void*)res))
|
||||
{
|
||||
RARCH_ERR("%s.\n",
|
||||
RARCH_ERR("[NetCMD]: %s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_BIND_SOCKET));
|
||||
goto error;
|
||||
}
|
||||
@ -546,8 +546,8 @@ static bool command_verify(const char *cmd)
|
||||
if (command_get_arg(cmd, NULL, NULL))
|
||||
return true;
|
||||
|
||||
RARCH_ERR("Command \"%s\" is not recognized by the program.\n", cmd);
|
||||
RARCH_ERR("\tValid commands:\n");
|
||||
RARCH_ERR("[NetCMD]: Command \"%s\" is not recognized by the program.\n", cmd);
|
||||
RARCH_ERR("[NetCMD]: \tValid commands:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(map); i++)
|
||||
RARCH_ERR("\t\t%s\n", map[i].str);
|
||||
|
||||
@ -589,7 +589,7 @@ bool command_network_send(const char *cmd_)
|
||||
if (port_)
|
||||
port = strtoul(port_, NULL, 0);
|
||||
|
||||
RARCH_LOG("%s: \"%s\" to %s:%hu\n",
|
||||
RARCH_LOG("[NetCMD]: %s: \"%s\" to %s:%hu\n",
|
||||
msg_hash_to_str(MSG_SENDING_COMMAND),
|
||||
cmd, host, (unsigned short)port);
|
||||
|
||||
@ -660,7 +660,7 @@ bool command_write_ram(command_t *cmd, const char *arg)
|
||||
|
||||
if (rcheevos_hardcore_active())
|
||||
{
|
||||
RARCH_LOG("Achievements hardcore mode disabled by WRITE_CORE_RAM\n");
|
||||
RARCH_LOG("[Command]: Achievements hardcore mode disabled by WRITE_CORE_RAM.\n");
|
||||
rcheevos_pause_hardcore();
|
||||
}
|
||||
|
||||
@ -849,7 +849,7 @@ bool command_write_memory(command_t *cmd, const char *arg)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (rcheevos_hardcore_active())
|
||||
{
|
||||
RARCH_LOG("Achievements hardcore mode disabled by WRITE_CORE_MEMORY\n");
|
||||
RARCH_LOG("[Command]: Achievements hardcore mode disabled by WRITE_CORE_MEMORY.\n");
|
||||
rcheevos_pause_hardcore();
|
||||
}
|
||||
#endif
|
||||
@ -1171,9 +1171,10 @@ bool command_event_load_entry_state(void)
|
||||
|
||||
ret = content_load_state(entry_state_path, false, true);
|
||||
|
||||
RARCH_LOG("%s: %s\n%s \"%s\" %s.\n",
|
||||
RARCH_LOG("[State]: %s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FOUND_ENTRY_STATE_IN),
|
||||
entry_state_path,
|
||||
entry_state_path);
|
||||
RARCH_LOG("[State]: %s \"%s\" %s.\n",
|
||||
msg_hash_to_str(MSG_LOADING_ENTRY_STATE_FROM),
|
||||
entry_state_path, ret ? "succeeded" : "failed"
|
||||
);
|
||||
@ -1205,9 +1206,10 @@ void command_event_load_auto_state(void)
|
||||
|
||||
ret = content_load_state(savestate_name_auto, false, true);
|
||||
|
||||
RARCH_LOG("%s: %s\n%s \"%s\" %s.\n",
|
||||
RARCH_LOG("[State]: %s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FOUND_AUTO_SAVESTATE_IN),
|
||||
savestate_name_auto,
|
||||
savestate_name_auto);
|
||||
RARCH_LOG("[State]: %s \"%s\" %s.\n",
|
||||
msg_hash_to_str(MSG_AUTOLOADING_SAVESTATE_FROM),
|
||||
savestate_name_auto, ret ? "succeeded" : "failed"
|
||||
);
|
||||
@ -1273,7 +1275,7 @@ void command_event_set_savestate_auto_index(settings_t *settings)
|
||||
|
||||
configuration_set_int(settings, settings->ints.state_slot, max_idx);
|
||||
|
||||
RARCH_LOG("%s: #%d\n",
|
||||
RARCH_LOG("[State]: %s: #%d\n",
|
||||
msg_hash_to_str(MSG_FOUND_LAST_STATE_SLOT),
|
||||
max_idx);
|
||||
}
|
||||
@ -1431,7 +1433,7 @@ bool command_event_save_core_config(
|
||||
if (path_is_valid(core_path))
|
||||
{
|
||||
unsigned i;
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
|
||||
RARCH_LOG("[Config]: %s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
|
||||
|
||||
/* In case of collision, find an alternative name. */
|
||||
for (i = 0; i < 16; i++)
|
||||
@ -1535,7 +1537,7 @@ void command_event_save_current_config(enum override_type type)
|
||||
}
|
||||
else
|
||||
strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_ERROR_SAVING), sizeof(msg));
|
||||
RARCH_LOG("[Config - Overrides]: %s\n", msg);
|
||||
RARCH_LOG("[Overrides]: %s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
@ -1646,7 +1648,7 @@ bool command_event_main_state(unsigned cmd)
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[State]: %s\n", msg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -317,9 +317,9 @@ bool disk_control_set_eject_state(
|
||||
if (!string_is_empty(msg))
|
||||
{
|
||||
if (error)
|
||||
RARCH_ERR("%s\n", msg);
|
||||
RARCH_ERR("[Disc]: %s\n", msg);
|
||||
else
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[Disc]: %s\n", msg);
|
||||
|
||||
/* Errors should always be displayed */
|
||||
if (verbosity || error)
|
||||
@ -377,9 +377,9 @@ bool disk_control_set_index(
|
||||
if (!string_is_empty(msg))
|
||||
{
|
||||
if (error)
|
||||
RARCH_ERR("%s\n", msg);
|
||||
RARCH_ERR("[Disc]: %s\n", msg);
|
||||
else
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[Disc]: %s\n", msg);
|
||||
|
||||
/* Errors should always be displayed */
|
||||
if (verbosity || error)
|
||||
@ -446,7 +446,7 @@ bool disk_control_set_index_next(
|
||||
|
||||
if (!disk_next_enable)
|
||||
{
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
RARCH_ERR("[Disc]: %s\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@ bool disk_control_set_index_prev(
|
||||
|
||||
if (!disk_prev_enable)
|
||||
{
|
||||
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
RARCH_ERR("[Disc]: %s\n", msg_hash_to_str(MSG_GOT_INVALID_DISK_INDEX));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -565,7 +565,7 @@ bool disk_control_append_image(
|
||||
msg, sizeof(msg), "%s: %s",
|
||||
msg_hash_to_str(MSG_APPENDED_DISK), image_filename);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[Disc]: %s\n", msg);
|
||||
/* This message should always be displayed, since
|
||||
* the menu itself does not provide sufficient
|
||||
* visual feedback */
|
||||
@ -652,7 +652,7 @@ bool disk_control_set_initial_index(
|
||||
* here may not matter (have to wait until
|
||||
* disk index is verified) */
|
||||
RARCH_ERR(
|
||||
"Failed to set initial disk index: [%u] %s\n",
|
||||
"[Disc]: Failed to set initial disk index: [%u] %s\n",
|
||||
disk_control->index_record.image_index,
|
||||
disk_control->index_record.image_path);
|
||||
return false;
|
||||
@ -726,7 +726,7 @@ bool disk_control_verify_initial_index(
|
||||
if (!success)
|
||||
{
|
||||
RARCH_ERR(
|
||||
"Failed to set initial disk index:\n> Expected [%u] %s\n> Detected [%u] %s\n",
|
||||
"[Disc]: Failed to set initial disk index:\n> Expected [%u] %s\n> Detected [%u] %s\n",
|
||||
disk_control->index_record.image_index + 1,
|
||||
disk_control->index_record.image_path,
|
||||
image_index + 1,
|
||||
@ -770,7 +770,7 @@ bool disk_control_verify_initial_index(
|
||||
disk_control, disk_control->initial_num_images, image_index, true,
|
||||
&msg_duration, msg, sizeof(msg));
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[Disc]: %s\n", msg);
|
||||
|
||||
/* Note: Do not flush message queue here, since
|
||||
* it is likely other notifications will be
|
||||
|
@ -957,7 +957,7 @@ void recording_dump_frame(
|
||||
|
||||
if (!vp.width || !vp.height)
|
||||
{
|
||||
RARCH_WARN("[recording] %s \n",
|
||||
RARCH_WARN("[Recording]: %s\n",
|
||||
msg_hash_to_str(MSG_VIEWPORT_SIZE_CALCULATION_FAILED));
|
||||
video_driver_gpu_record_deinit();
|
||||
recording_dump_frame(
|
||||
@ -969,7 +969,7 @@ void recording_dump_frame(
|
||||
if ( vp.width != record_st->gpu_width ||
|
||||
vp.height != record_st->gpu_height)
|
||||
{
|
||||
RARCH_WARN("[recording] %s\n",
|
||||
RARCH_WARN("[Recording]: %s\n",
|
||||
msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE));
|
||||
|
||||
runloop_msg_queue_push(
|
||||
|
@ -179,7 +179,7 @@ static void winraw_log_mice_info(winraw_mouse_t *mice, unsigned mouse_cnt)
|
||||
|
||||
input_config_set_mouse_display_name(i, name);
|
||||
|
||||
RARCH_LOG("[WINRAW]: Mouse #%u: \"%s\".\n", i, name);
|
||||
RARCH_LOG("[WinRaw]: Mouse #%u: \"%s\".\n", i, name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,7 +371,7 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
{
|
||||
if (wr->rect_delay < 10)
|
||||
{
|
||||
RARCH_DBG("[CRT][WINRAW]: Resize RECT delay for absolute co-ords - %d \n", wr->rect_delay);
|
||||
RARCH_DBG("[CRT][WinRaw]: Resize RECT delay for absolute co-ords - %d \n", wr->rect_delay);
|
||||
winraw_init_mouse_xy_mapping(wr); /* Triggering fewer times seems to fix the issue. Forcing resize while resolution is changing */
|
||||
wr->rect_delay ++;
|
||||
}
|
||||
@ -379,7 +379,7 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
{
|
||||
int bottom = wr->prev_rect.bottom;
|
||||
int right = wr->prev_rect.right;
|
||||
RARCH_DBG("[CRT][WINRAW]: Resizing RECT for absolute coordinates to match new resolution - %dx%d\n", right ,bottom);
|
||||
RARCH_DBG("[CRT][WinRaw]: Resizing RECT for absolute coordinates to match new resolution - %dx%d\n", right ,bottom);
|
||||
wr->active_rect = wr->prev_rect;
|
||||
winraw_init_mouse_xy_mapping(wr);
|
||||
wr->rect_delay = 0;
|
||||
@ -406,9 +406,9 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
InterlockedExchangeAdd(&mouse->dlt_y, state->lLastY);
|
||||
|
||||
if (!GetCursorPos(&crs_pos))
|
||||
RARCH_DBG("[WINRAW]: GetCursorPos failed with error %lu.\n", GetLastError());
|
||||
RARCH_DBG("[WinRaw]: GetCursorPos failed with error %lu.\n", GetLastError());
|
||||
else if (!ScreenToClient((HWND)video_driver_window_get(), &crs_pos))
|
||||
RARCH_DBG("[WINRAW]: ScreenToClient failed with error %lu.\n", GetLastError());
|
||||
RARCH_DBG("[WinRaw]: ScreenToClient failed with error %lu.\n", GetLastError());
|
||||
else
|
||||
{
|
||||
mouse->x = crs_pos.x;
|
||||
|
@ -11479,11 +11479,11 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT,
|
||||
"[Core Options]: Game-specific core options found at"
|
||||
"Game-specific core options found at"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_FOLDER_SPECIFIC_CORE_OPTIONS_FOUND_AT,
|
||||
"[Core Options]: Folder-specific core options found at"
|
||||
"Folder-specific core options found at"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_GOT_INVALID_DISK_INDEX,
|
||||
|
@ -7339,7 +7339,7 @@ bool menu_shader_manager_set_preset(struct video_shader *shader,
|
||||
!(video_shader_load_preset_into_shader(preset_path, shader)))
|
||||
goto end;
|
||||
|
||||
RARCH_LOG("Menu shader set to: %s.\n", preset_path);
|
||||
RARCH_LOG("[Shaders]: Menu shader set to: %s.\n", preset_path);
|
||||
|
||||
ret = true;
|
||||
|
||||
|
29
runloop.c
29
runloop.c
@ -1125,7 +1125,7 @@ static bool validate_game_specific_options(char **output)
|
||||
!path_is_valid(game_options_path))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("%s %s\n",
|
||||
RARCH_LOG("[Core]: %s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_GAME_SPECIFIC_CORE_OPTIONS_FOUND_AT),
|
||||
game_options_path);
|
||||
*output = strdup(game_options_path);
|
||||
@ -1172,7 +1172,7 @@ static bool validate_folder_specific_options(
|
||||
!path_is_valid(folder_options_path))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("%s %s\n",
|
||||
RARCH_LOG("[Core]: %s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_FOLDER_SPECIFIC_CORE_OPTIONS_FOUND_AT),
|
||||
folder_options_path);
|
||||
*output = strdup(folder_options_path);
|
||||
@ -1473,7 +1473,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
char s[128];
|
||||
s[0] = '\0';
|
||||
|
||||
snprintf(s, sizeof(s), "[Environ]: GET_VARIABLE %s:\n\t%s\n",
|
||||
snprintf(s, sizeof(s), "[Environ]: GET_VARIABLE: %s = \"%s\"\n",
|
||||
var->key, var->value ? var->value :
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE));
|
||||
RARCH_LOG(s);
|
||||
@ -2134,7 +2134,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
if (!description)
|
||||
continue;
|
||||
|
||||
RARCH_LOG("\tRetroPad, Port %u, Button \"%s\" => \"%s\"\n",
|
||||
RARCH_LOG(" RetroPad, Port %u, Button \"%s\" => \"%s\"\n",
|
||||
p + 1, libretro_btn_desc[retro_id], description);
|
||||
}
|
||||
}
|
||||
@ -2728,9 +2728,9 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
if (log_level != RETRO_LOG_DEBUG)
|
||||
continue;
|
||||
|
||||
RARCH_LOG("Controller port: %u\n", i + 1);
|
||||
RARCH_LOG(" Controller port: %u\n", i + 1);
|
||||
for (j = 0; j < info[i].num_types; j++)
|
||||
RARCH_LOG(" %s (ID: %u)\n", info[i].types[j].desc,
|
||||
RARCH_LOG(" %s (ID: %u)\n", info[i].types[j].desc,
|
||||
info[i].types[j].id);
|
||||
}
|
||||
|
||||
@ -2759,9 +2759,10 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
if (system)
|
||||
{
|
||||
unsigned i;
|
||||
const struct retro_memory_map *mmaps =
|
||||
const struct retro_memory_map *mmaps =
|
||||
(const struct retro_memory_map*)data;
|
||||
rarch_memory_descriptor_t *descriptors = NULL;
|
||||
unsigned int log_level = settings->uints.libretro_log_level;
|
||||
|
||||
RARCH_LOG("[Environ]: SET_MEMORY_MAPS.\n");
|
||||
free((void*)system->mmaps.descriptors);
|
||||
@ -2774,6 +2775,9 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
if (!descriptors)
|
||||
return false;
|
||||
|
||||
if (log_level != RETRO_LOG_DEBUG)
|
||||
break;
|
||||
|
||||
system->mmaps.descriptors = descriptors;
|
||||
system->mmaps.num_descriptors = mmaps->num_descriptors;
|
||||
|
||||
@ -2782,12 +2786,10 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
mmap_preprocess_descriptors(descriptors, mmaps->num_descriptors);
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (sizeof(void *) == 8)
|
||||
RARCH_LOG(" ndx flags ptr offset start select disconn len addrspace\n");
|
||||
RARCH_LOG(" ndx flags ptr offset start select disconn len addrspace\n");
|
||||
else
|
||||
RARCH_LOG(" ndx flags ptr offset start select disconn len addrspace\n");
|
||||
#endif
|
||||
RARCH_LOG(" ndx flags ptr offset start select disconn len addrspace\n");
|
||||
|
||||
for (i = 0; i < system->mmaps.num_descriptors; i++)
|
||||
{
|
||||
@ -2819,7 +2821,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
flags[5] = (desc->core.flags & RETRO_MEMDESC_CONST) ? 'C' : 'c';
|
||||
flags[6] = 0;
|
||||
|
||||
RARCH_LOG(" %03u %s %p %08X %08X %08X %08X %08X %s\n",
|
||||
RARCH_LOG(" %03u %s %p %08X %08X %08X %08X %08X %s\n",
|
||||
i + 1, flags, desc->core.ptr, desc->core.offset, desc->core.start,
|
||||
desc->core.select, desc->core.disconnect, desc->core.len,
|
||||
desc->core.addrspace ? desc->core.addrspace : "");
|
||||
@ -2829,7 +2831,6 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
RARCH_WARN("[Environ]: SET_MEMORY_MAPS, but system pointer not initialized..\n");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -7080,7 +7081,7 @@ static enum runloop_state_enum runloop_check_state(
|
||||
settings->ints.state_slot);
|
||||
runloop_msg_queue_push(msg, 2, 180, true, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
RARCH_LOG("[State]: %s\n", msg);
|
||||
}
|
||||
|
||||
old_should_slot_increase = should_slot_increase;
|
||||
|
Loading…
x
Reference in New Issue
Block a user