diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-06-19 16:22:11 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-06-21 23:27:21 +0100 |
commit | 335bbe4f52b9fdb74e377b83906eaab4456666cf (patch) | |
tree | cc2818de6289fc0f01d4d9bd8e31b8428a8d6bb5 /utils | |
parent | 9ccf0cee9f4c070146a225fc633591436b1a88eb (diff) | |
download | netsurf-335bbe4f52b9fdb74e377b83906eaab4456666cf.tar.gz netsurf-335bbe4f52b9fdb74e377b83906eaab4456666cf.tar.bz2 |
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.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/log.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/log.c b/utils/log.c index d67ed7677..cc3f7a8df 100644 --- a/utils/log.c +++ b/utils/log.c @@ -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; } |