mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-25 12:53:09 -04:00
tune logging
This commit is contained in:
parent
9e7de7965a
commit
81afc997c7
@ -775,7 +775,7 @@ void dispatch_stream_id(WS_CONNINFO *pwsc, int session, char *id) {
|
|||||||
"Transcoding '%s' (id %d)",
|
"Transcoding '%s' (id %d)",
|
||||||
pmp3->title,pmp3->id);
|
pmp3->title,pmp3->id);
|
||||||
|
|
||||||
DPRINTF(E_LOG,L_WS,
|
DPRINTF(E_WARN,L_WS,
|
||||||
"Session %d: Streaming file '%s' to %s (offset %ld)\n",
|
"Session %d: Streaming file '%s' to %s (offset %ld)\n",
|
||||||
session,pmp3->fname, pwsc->hostname,(long)offset);
|
session,pmp3->fname, pwsc->hostname,(long)offset);
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ void dispatch_stream_id(WS_CONNINFO *pwsc, int session, char *id) {
|
|||||||
|
|
||||||
config_set_status(pwsc,session,"Streaming '%s' (id %d)",
|
config_set_status(pwsc,session,"Streaming '%s' (id %d)",
|
||||||
pmp3->title, pmp3->id);
|
pmp3->title, pmp3->id);
|
||||||
DPRINTF(E_LOG,L_WS,"Session %d: Streaming file '%s' to %s (offset %d)\n",
|
DPRINTF(E_WARN,L_WS,"Session %d: Streaming file '%s' to %s (offset %d)\n",
|
||||||
session,pmp3->fname, pwsc->hostname,(long)offset);
|
session,pmp3->fname, pwsc->hostname,(long)offset);
|
||||||
|
|
||||||
if(!offset)
|
if(!offset)
|
||||||
|
@ -293,8 +293,6 @@ int err_setlogfile(char *file) {
|
|||||||
* \param destination where to log to \ref log_dests "as defined in err.h"
|
* \param destination where to log to \ref log_dests "as defined in err.h"
|
||||||
*/
|
*/
|
||||||
void err_setdest(int destination) {
|
void err_setdest(int destination) {
|
||||||
fprintf(stderr,"setting dest to %d\n",destination);
|
|
||||||
|
|
||||||
if(err_logdest == destination)
|
if(err_logdest == destination)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#define E_SPAM 10 /**< Logorrhea! */
|
#define E_SPAM 10 /**< Logorrhea! */
|
||||||
#define E_DBG 9 /**< Way too verbose */
|
#define E_DBG 9 /**< Way too verbose */
|
||||||
#define E_INF 5 /**< Good info, not too much spam */
|
#define E_INF 5 /**< Good info, not too much spam */
|
||||||
#define E_WARN 2 /**< Reasonably important, but not enough to log */
|
#define E_WARN 2 /**< Goes in text log, but not syslog */
|
||||||
#define E_LOG 1 /**< Something that should go in a log file */
|
#define E_LOG 1 /**< Something that should go in a log file */
|
||||||
#define E_FATAL 0 /**< Log and force an exit */
|
#define E_FATAL 0 /**< Log and force an exit */
|
||||||
|
|
||||||
|
11
src/main.c
11
src/main.c
@ -233,7 +233,7 @@ int main(int argc, char *argv[]) {
|
|||||||
int debuglevel=0;
|
int debuglevel=0;
|
||||||
|
|
||||||
config.use_mdns=1;
|
config.use_mdns=1;
|
||||||
err_setlevel(debuglevel);
|
err_setlevel(2);
|
||||||
|
|
||||||
config.foreground=0;
|
config.foreground=0;
|
||||||
while((option=getopt(argc,argv,"D:d:c:P:mfrysiuvab:")) != -1) {
|
while((option=getopt(argc,argv,"D:d:c:P:mfrysiuvab:")) != -1) {
|
||||||
@ -241,19 +241,23 @@ int main(int argc, char *argv[]) {
|
|||||||
case 'a':
|
case 'a':
|
||||||
appdir = 1;
|
appdir = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
ffid=optarg;
|
ffid=optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
debuglevel = atoi(optarg);
|
debuglevel = atoi(optarg);
|
||||||
err_setlevel(debuglevel);
|
err_setlevel(debuglevel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
if(err_setdebugmask(optarg)) {
|
if(err_setdebugmask(optarg)) {
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
config.foreground=1;
|
config.foreground=1;
|
||||||
err_setdest(err_getdest() | LOGDEST_STDERR);
|
err_setdest(err_getdest() | LOGDEST_STDERR);
|
||||||
@ -307,8 +311,9 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((getuid()) && (!force_non_root) && (!convert_conf)) {
|
if((getuid()) && (!force_non_root) && (!convert_conf)) {
|
||||||
fprintf(stderr,"You are not root. This is almost certainly wrong. If you are\n"
|
fprintf(stderr,"You are not root. This is almost certainly wrong. "
|
||||||
"sure you want to do this, use the -y command-line switch\n");
|
"If you are\nsure you want to do this, use the -y "
|
||||||
|
"command-line switch\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +150,6 @@ char *os_realpath(const char *pathname, char *resolved_path) {
|
|||||||
int os_stat(const char *path, struct _stat *sb) {
|
int os_stat(const char *path, struct _stat *sb) {
|
||||||
WCHAR utf16_path[PATH_MAX+1];
|
WCHAR utf16_path[PATH_MAX+1];
|
||||||
|
|
||||||
DPRINTF(E_LOG,L_MISC,"Statting %s\n",path);
|
|
||||||
memset(utf16_path,0,sizeof(utf16_path));
|
memset(utf16_path,0,sizeof(utf16_path));
|
||||||
util_utf8toutf16((unsigned char *)&utf16_path,PATH_MAX * 2,(char*)path,(int)strlen(path));
|
util_utf8toutf16((unsigned char *)&utf16_path,PATH_MAX * 2,(char*)path,(int)strlen(path));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user