Move the browser identification and machine info logging.

Previously this information was logged when netsurf_init was called
which might be many lines out output into the log.

It is useful to have this information at the beginning of the log to
make it easily found. In addition it makes netsurf_init less complex.
This commit is contained in:
Vincent Sanders 2015-06-19 16:22:11 +01:00
parent 9ccf0cee9f
commit 335bbe4f52
2 changed files with 20 additions and 9 deletions

View File

@ -26,7 +26,6 @@
#include <libwapcaplet/libwapcaplet.h>
#include "utils/config.h"
#include "utils/utsname.h"
#include "utils/nsoption.h"
#include "utils/corestrings.h"
#include "utils/log.h"
@ -45,7 +44,6 @@
#include "render/html.h"
#include "render/textplain.h"
#include "desktop/version.h"
#include "desktop/browser.h"
#include "desktop/system_colour.h"
#include "desktop/searchweb.h"
@ -127,7 +125,6 @@ static nserror netsurf_llcache_query_handler(const llcache_query *query,
nserror netsurf_init(const char *messages, const char *store_path)
{
nserror ret;
struct utsname utsname;
struct hlcache_parameters hlcache_parameters = {
.bg_clean_time = HL_CACHE_CLEAN_TIME,
.llcache = {
@ -154,12 +151,6 @@ nserror netsurf_init(const char *messages, const char *store_path)
signal(SIGPIPE, SIG_IGN);
#endif
LOG("NetSurf version '%s'", netsurf_version);
if (uname(&utsname) < 0)
LOG("Failed to extract machine information");
else
LOG("NetSurf on <%s>, node <%s>, release <%s>, version <%s>, ""machine <%s>", utsname.sysname, utsname.nodename, utsname.release, utsname.version, utsname.machine);
messages_load(messages);
/* corestrings init */

View File

@ -24,6 +24,10 @@
#include <stdio.h>
#include <sys/time.h>
#include "utils/config.h"
#include "utils/utsname.h"
#include "desktop/version.h"
#include "utils/log.h"
/** flag to enable verbose logging */
@ -34,6 +38,7 @@ static FILE *logfile;
nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
{
struct utsname utsname;
nserror ret = NSERROR_OK;
if (((*pargc) > 1) &&
@ -88,6 +93,21 @@ nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
verbose_log = false;
}
/* sucessfull logging initialisation so log system info */
if (ret == NSERROR_OK) {
LOG("NetSurf version '%s'", netsurf_version);
if (uname(&utsname) < 0) {
LOG("Failed to extract machine information");
} else {
LOG("NetSurf on <%s>, node <%s>, release <%s>, version <%s>, machine <%s>",
utsname.sysname,
utsname.nodename,
utsname.release,
utsname.version,
utsname.machine);
}
}
return ret;
}