summaryrefslogtreecommitdiff
path: root/src/cache/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache/handlers')
-rw-r--r--src/cache/handlers/cdio.c22
-rw-r--r--src/cache/handlers/http.c10
2 files changed, 16 insertions, 16 deletions
diff --git a/src/cache/handlers/cdio.c b/src/cache/handlers/cdio.c
index 3eae813..e978343 100644
--- a/src/cache/handlers/cdio.c
+++ b/src/cache/handlers/cdio.c
@@ -16,13 +16,13 @@ static void cdio_log_messages(struct cch_handler_cdio *cdio)
{
char *error_messages = cdio_cddap_errors(cdio->drive);
if (error_messages) {
- error("\n%s", error_messages);
+ log_error("\n%s", error_messages);
cdio_cddap_free_messages(error_messages);
}
char *messages = cdio_cddap_messages(cdio->drive);
if (messages) {
- info("\n%s", messages);
+ log_info("\n%s", messages);
cdio_cddap_free_messages(messages);
}
}
@@ -51,18 +51,18 @@ static nn_thread_result NNWT_THREADCALL cd_read_thread(void *userdata)
size_t size;
u8 *ptr = cdio->backing->get_ptr(cdio->backing, pointer, &size);
if (size < BYTES_PER_STEP) {
- error("Tried to write over expected size during normal operation.");
+ log_error("Tried to write over expected size during normal operation.");
cdio->backing->unlock(cdio->backing);
break;
}
if (ret == SECTORS_PER_STEP) {
al_memcpy(ptr, nn_buffer_get_ptr(&cdio->buffer, 0), BYTES_PER_STEP);
} else if (ret == -10) {
- error("I/O error, skipping sector.");
+ log_error("I/O error, skipping sector.");
al_memset(ptr, 0, BYTES_PER_STEP);
ret = SECTORS_PER_STEP;
} else if (ret < 0) {
- error("Fatal error (%d).", ret);
+ log_error("Fatal error (%d).", ret);
cdio->backing->unlock(cdio->backing);
break;
}
@@ -71,13 +71,13 @@ static nn_thread_result NNWT_THREADCALL cd_read_thread(void *userdata)
cdio->backing->unlock(cdio->backing);
cch_threaded_waits_evaluate(&cdio->waits, cdio->backing);
if (ret < SECTORS_PER_STEP || cdio->sector > cdio->end) {
- debug("Normal CD EOF.");
+ log_debug("Normal CD EOF.");
break;
}
}
if (cdio->sector <= cdio->end) {
- warn("Disc read cut short (sectors: %zd, end: %zd).", cdio->sector, cdio->end);
+ log_warn("Disc read cut short (sectors: %zd, end: %zd).", cdio->sector, cdio->end);
// We didn't read the full disc, disable waiters.
cch_threaded_waits_disable_all(&cdio->waits);
}
@@ -135,7 +135,7 @@ static bool open_cd_drive(struct cch_handler_cdio *cdio)
cdio_handle = cdio_open(*cd_drives, DRIVER_UNKNOWN);
drive = cdio_cddap_identify_cdio(cdio_handle, CDDA_MESSAGE_LOGIT, NULL);
} else {
- error("No compatible disc found.");
+ log_error("No compatible disc found.");
return false;
}
cdio_free_device_list(cd_drives);
@@ -144,19 +144,19 @@ static bool open_cd_drive(struct cch_handler_cdio *cdio)
s32 ret = cdio_cddap_open(drive);
if (ret != 0) {
- error("Unable to open disc (%d).", ret);
+ log_error("Unable to open disc (%d).", ret);
return false;
}
ret = cdio_cddap_speed_set(drive, 4);
if (ret != 0) {
- warn("Failed to set drive speed (%d).", ret);
+ log_warn("Failed to set drive speed (%d).", ret);
}
track_t tracks = cdio_cddap_tracks(drive);
track_t first_track = cdio_get_first_track_num(drive->p_cdio);
track_t last_track = cdio_get_last_track_num(drive->p_cdio);
- info("CD with %d tracks loaded (%d-%d).", tracks, first_track, last_track);
+ log_info("CD with %d tracks loaded (%d-%d).", tracks, first_track, last_track);
al_array_reserve(cdio->handler.entry->chapters, tracks);
lsn_t start = cdio_cddap_disc_firstsector(drive);
diff --git a/src/cache/handlers/http.c b/src/cache/handlers/http.c
index 6ff5a3c..08bd165 100644
--- a/src/cache/handlers/http.c
+++ b/src/cache/handlers/http.c
@@ -36,23 +36,23 @@ static void http_callback(void *userdata, u8 op, u8 *buf, void *opaque)
}
case NNWT_HTTP_RESPONSE_CODE: {
long response_code = *(long *)opaque;
- debug("HTTP %ld.", response_code);
+ log_debug("HTTP %ld.", response_code);
break;
}
case NNWT_HTTP_CONTENT_LENGTH: {
curl_off_t length = *(curl_off_t *)opaque;
- debug("Content-Length: %"CURL_FORMAT_CURL_OFF_T".", length);
+ log_debug("Content-Length: %"CURL_FORMAT_CURL_OFF_T".", length);
cch_entry_set_size(http->handler.entry, length);
cch_threaded_waits_signal_any(&http->waits);
break;
}
case NNWT_HTTP_REDIRECT: {
long response_code = *(long *)opaque;
- debug("Redirect %ld.", response_code);
+ log_debug("Redirect %ld.", response_code);
break;
}
case NNWT_HTTP_FINISHED:
- debug("Transfer finished.");
+ log_debug("Transfer finished.");
break;
case NNWT_HTTP_ERROR:
cch_threaded_waits_disable_all(&http->waits);
@@ -72,7 +72,7 @@ static void handler_http_maybe_spawn_worker(struct cch_handler *handler, size_t
nn_http_set_url(request, &http->url);
nn_http_set_user_agent(request, &USER_AGENT);
nn_http_request_stream(request, NNWT_HTTP_GET, http->loop, http_callback, http);
- debug("Spawning worker for %.*s.", al_str_x(&http->url));
+ log_debug("Spawning worker for %.*s.", al_str_x(&http->url));
}
static bool handler_http_wait_for_range(struct cch_handler *handler, struct cch_handler_wait *wait)