mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 14:31:20 +03:00
Add a -v option to enable debug logging. Pass -v by default to the RO runimage.
svn path=/trunk/netsurf/; revision=3306
This commit is contained in:
parent
7bc1a41ea0
commit
25e22eb1f5
@ -100,7 +100,7 @@ CDir <Wimp$ScrapDir>.WWW.NetSurf
|
||||
FontInstall NetSurf:Resources.Fonts.
|
||||
|
||||
WimpSlot -min 2240k -max 2240k
|
||||
Run <NetSurf$Dir>.!RunImage %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
|
||||
Run <NetSurf$Dir>.!RunImage -v %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
|
||||
|
||||
| Uninstall NetSurf-specific fonts
|
||||
FontRemove NetSurf:Resources.Fonts.
|
||||
FontRemove NetSurf:Resources.Fonts.
|
||||
|
@ -248,7 +248,11 @@ void fetch_init(void)
|
||||
if (code != CURLE_OK) \
|
||||
goto curl_easy_setopt_failed;
|
||||
|
||||
SETOPT(CURLOPT_VERBOSE, 1);
|
||||
if (verbose_log) {
|
||||
SETOPT(CURLOPT_VERBOSE, 1);
|
||||
} else {
|
||||
SETOPT(CURLOPT_VERBOSE, 0);
|
||||
}
|
||||
SETOPT(CURLOPT_ERRORBUFFER, fetch_error_buffer);
|
||||
SETOPT(CURLOPT_WRITEFUNCTION, fetch_curl_data);
|
||||
SETOPT(CURLOPT_HEADERFUNCTION, fetch_curl_header);
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "netsurf/utils/utils.h"
|
||||
|
||||
bool netsurf_quit = false;
|
||||
bool verbose_log = false;
|
||||
|
||||
static void netsurf_init(int argc, char** argv);
|
||||
static void netsurf_poll(void);
|
||||
@ -66,6 +67,15 @@ void netsurf_init(int argc, char** argv)
|
||||
|
||||
stdout = stderr;
|
||||
|
||||
if ((argc > 1) && (argv[1][0] == '-') && (argv[1][1] == 'v') && (argv[1][2] == 0)) {
|
||||
int argcmv;
|
||||
verbose_log = true;
|
||||
for (argcmv = 2; argcmv < argc; argcmv++) {
|
||||
argv[argcmv - 1] = argv[argcmv];
|
||||
}
|
||||
argc--;
|
||||
}
|
||||
|
||||
#ifdef _MEMDEBUG_H_
|
||||
memdebug_memdebug("memdump");
|
||||
#endif
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
extern bool netsurf_quit;
|
||||
extern bool verbose_log;
|
||||
extern const char * const netsurf_version;
|
||||
extern const int netsurf_version_major;
|
||||
extern const int netsurf_version_minor;
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "netsurf/desktop/netsurf.h"
|
||||
|
||||
#ifndef _NETSURF_LOG_H_
|
||||
#define _NETSURF_LOG_H_
|
||||
@ -15,11 +16,11 @@
|
||||
# define LOG(x) ((void) 0)
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define LOG(x) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout))
|
||||
# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout)); } while (0)
|
||||
# elif defined(__CC_NORCROFT)
|
||||
# define LOG(x) (printf(__FILE__ " %s %i: ", __func__, __LINE__), printf x, fputc('\n', stdout))
|
||||
# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %s %i: ", __func__, __LINE__), printf x, fputc('\n', stdout)); } while (0)
|
||||
# else
|
||||
# define LOG(x) (printf(__FILE__ " %i: ", __LINE__), printf x, fputc('\n', stdout))
|
||||
# define LOG(x) do { if (verbose_log) (printf(__FILE__ " %i: ", __LINE__), printf x, fputc('\n', stdout)); } while (0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user