projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed restoration of the panel divider position.
[psensor.git]
/
src
/
rsensor.c
diff --git
a/src/rsensor.c
b/src/rsensor.c
index
96b3346
..
f42ab76
100644
(file)
--- a/
src/rsensor.c
+++ b/
src/rsensor.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
4
jeanfi@gmail.com
+ * Copyright (C) 2010-201
6
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-38,6
+38,8
@@
struct ucontent {
static CURL *curl;
static CURL *curl;
+static const char *PROVIDER_NAME = "rsensor";
+
static const char *get_url(struct psensor *s)
{
return (char *)s->provider_data;
static const char *get_url(struct psensor *s)
{
return (char *)s->provider_data;
@@
-105,11
+107,12
@@
static json_object *get_json_object(const char *url)
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
- log_debug("HTTP request %s", url);
+ log_fct("%s: HTTP request %s", PROVIDER_NAME, url);
+
if (curl_easy_perform(curl) == CURLE_OK)
obj = json_tokener_parse(chunk.data);
else
if (curl_easy_perform(curl) == CURLE_OK)
obj = json_tokener_parse(chunk.data);
else
- log_
printf(LOG_ERR, _("Fail to connect to: %s")
, url);
+ log_
err(_("%s: Fail to connect to: %s"), PROVIDER_NAME
, url);
free(chunk.data);
free(chunk.data);
@@
-146,7
+149,7
@@
struct psensor **get_remote_sensors(const char *server_url,
json_object_put(obj);
} else {
json_object_put(obj);
} else {
- log_
printf(LOG_ERR, _("Invalid content: %s")
, url);
+ log_
err(_("%s: Invalid content: %s"), PROVIDER_NAME
, url);
}
free(url);
}
free(url);
@@
-186,7
+189,7
@@
static void remote_psensor_update(struct psensor *s)
json_object_put(obj);
} else {
json_object_put(obj);
} else {
- log_
printf(LOG_ERR, _("Invalid JSON: %s")
, get_url(s));
+ log_
err(_("%s: Invalid JSON: %s"), PROVIDER_NAME
, get_url(s));
}
}
}
}