Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6
...commit
http://git.netsurf-browser.org/netsurf.git/commit/10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6
...tree
http://git.netsurf-browser.org/netsurf.git/tree/10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6
The branch, master has been updated
via 10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6 (commit)
via 6fdc692aa523a642770747042c82153933fa734c (commit)
via 1be9127ee70d4850f54b2e7b21bdd06f465bfe08 (commit)
via 2b8531ff490a8f262a4f416e8568fdd9dabb5bfd (commit)
via 0312c45d6f616fdfb6cddabb0689f60a06f86df3 (commit)
via d24017474174614c630fbfde1c53415cf1a6fdfa (commit)
from d27027d4ba21921365737e358b3d26e2159488c3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6
commit 10930fcbaf985bdc414e9a7951dc8a0e3e9d53f6
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Properly set log levels
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/javascript/duktape/Console.bnd
b/content/handlers/javascript/duktape/Console.bnd
index acaab16..cf4bc4f 100644
--- a/content/handlers/javascript/duktape/Console.bnd
+++ b/content/handlers/javascript/duktape/Console.bnd
@@ -89,37 +89,37 @@ method Console::groupEnd ()
method Console::info()
%{
- write_log_entry(ctx, priv->group, 'I');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
method Console::debug()
%{
- write_log_entry(ctx, priv->group, 'D');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_DEBUG);
return 0;
%}
method Console::error()
%{
- write_log_entry(ctx, priv->group, 'E');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_ERROR);
return 0;
%}
method Console::log()
%{
- write_log_entry(ctx, priv->group, 'L');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_LOG);
return 0;
%}
method Console::warn()
%{
- write_log_entry(ctx, priv->group, 'W');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_WARN);
return 0;
%}
method Console::dir()
%{
- write_log_entry(ctx, priv->group, 'd');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
@@ -182,7 +182,7 @@ method Console::timeEnd()
duk_push_string(ctx, "Timer elapsed: ");
duk_insert(ctx, 0);
duk_push_sprintf(ctx, "%lu ms", (duk_uint_t)(time_ms - old_time_ms));
- write_log_entry(ctx, priv->group, 'T');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
@@ -193,6 +193,6 @@ method Console::trace ()
duk_safe_to_string(ctx, -1);
duk_insert(ctx, 0);
duk_set_top(ctx, 1);
- write_log_entry(ctx, priv->group, 'S');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=6fdc692aa523a642770747042c82153933fa734c
commit 6fdc692aa523a642770747042c82153933fa734c
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Support DEBUG log level in console_log
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/desktop/browser.c b/desktop/browser.c
index 3661407..9795f96 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -3458,6 +3458,9 @@ nserror browser_window_console_log(struct browser_window
*bw,
"unknown input location"));
switch (log_level) {
+ case BW_CS_FLAG_LEVEL_DEBUG:
+ NSLOG(netsurf, DEBUG, "%.*s", (int)msglen, msg);
+ break;
case BW_CS_FLAG_LEVEL_LOG:
NSLOG(netsurf, VERBOSE, "%.*s", (int)msglen, msg);
break;
diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c
index 903c453..b7aea92 100644
--- a/frontends/monkey/browser.c
+++ b/frontends/monkey/browser.c
@@ -378,6 +378,9 @@ gui_window_console_log(struct gui_window *g,
}
switch (flags & BW_CS_FLAG_LEVEL_MASK) {
+ case BW_CS_FLAG_LEVEL_DEBUG:
+ level_text = "DEBUG";
+ break;
case BW_CS_FLAG_LEVEL_LOG:
level_text = "LOG";
break;
diff --git a/include/netsurf/console.h b/include/netsurf/console.h
index 31ed0e7..dead3fd 100644
--- a/include/netsurf/console.h
+++ b/include/netsurf/console.h
@@ -49,16 +49,19 @@ typedef enum {
*/
BW_CS_FLAG_FOLDABLE = 1 << 0,
+ /** Logged at the 'debug' level, please use only one of the LEVEL flags
*/
+ BW_CS_FLAG_LEVEL_DEBUG = 0 << 1,
/** Logged at the 'log' level, please only use one of the LEVEL flags */
- BW_CS_FLAG_LEVEL_LOG = 0 << 1,
+ BW_CS_FLAG_LEVEL_LOG = 1 << 1,
/** Logged at the 'info' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_INFO = 1 << 1,
+ BW_CS_FLAG_LEVEL_INFO = 2 << 1,
/** Logged at the 'warn' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_WARN = 2 << 1,
+ BW_CS_FLAG_LEVEL_WARN = 3 << 1,
/** Logged at the 'error' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_ERROR = 3 << 1,
+ BW_CS_FLAG_LEVEL_ERROR = 4 << 1,
+ /* Levels 5, 6, 7 unused as yet */
/** Mask for the error level to allow easy comparison using the above */
- BW_CS_FLAG_LEVEL_MASK = 3 << 1,
+ BW_CS_FLAG_LEVEL_MASK = 7 << 1,
} browser_window_console_flags;
#endif /* _NETSURF_CONSOLE_H_ */
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=1be9127ee70d4850f54b2e7b21bdd06f465bfe08
commit 1be9127ee70d4850f54b2e7b21bdd06f465bfe08
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Update using-monkey docs for console logging output
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/docs/using-monkey.md b/docs/using-monkey.md
index 8d051cf..5e543d6 100644
--- a/docs/using-monkey.md
+++ b/docs/using-monkey.md
@@ -135,9 +135,7 @@ Commands
Cause a browser window to execute some javascript. It won't
work if the window doesn't have a *finished* HTML content.
- This will send a `WINDOW JS WIN` _%id%_ `RET` `TRUE`/`FALSE`
- where `FALSE` indicates that some issue prevented the injection of
- the script.
+ This will send a `JS` message back.
### Login commands
@@ -355,6 +353,18 @@ Responses
The core wraps redraws in these messages. Thus `PLOT` responses can
be allocated to the appropriate window.
+* `WINDOW JS WIN` _%id%_ `RET` `TRUE`/`FALSE`
+
+ Here `FALSE` indicates that some issue prevented the injection of
+ the script.
+
+* `WINDOW CONSOLE_LOG WIN` _%id%_ `SOURCE` _%source%_ _%foldable%_ _%level%_
_%str%_
+
+ Here, _%source%_ will be one of: `client-input`, `scripting-error`, or
+ `scripting-console`. _%foldable%_ will be one of `FOLDABLE` or
+ `NOT-FOLDABLE`. _%level%_ will be one of `LOG`, `INFO`, `WARN`, or
+ `ERROR`. The terminal string will be the log message.
+
### Download window messages
* `DOWNLOAD CREATE DWIN` _%id%_ `WIN` _%id%_
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=2b8531ff490a8f262a4f416e8568fdd9dabb5bfd
commit 2b8531ff490a8f262a4f416e8568fdd9dabb5bfd
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Monkey: Support console_log
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c
index 50b586f..903c453 100644
--- a/frontends/monkey/browser.c
+++ b/frontends/monkey/browser.c
@@ -350,7 +350,56 @@ gui_window_save_link(struct gui_window *g, nsurl *url,
const char *title)
return NSERROR_OK;
}
+static void
+gui_window_console_log(struct gui_window *g,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags)
+{
+ bool foldable = !!(flags & BW_CS_FLAG_FOLDABLE);
+ const char *src_text;
+ const char *level_text;
+ switch (src) {
+ case BW_CS_INPUT:
+ src_text = "client-input";
+ break;
+ case BW_CS_SCRIPT_ERROR:
+ src_text = "scripting-error";
+ break;
+ case BW_CS_SCRIPT_CONSOLE:
+ src_text = "scripting-console";
+ break;
+ default:
+ assert(0 && "Unknown scripting source");
+ src_text = "unknown";
+ break;
+ }
+
+ switch (flags & BW_CS_FLAG_LEVEL_MASK) {
+ case BW_CS_FLAG_LEVEL_LOG:
+ level_text = "LOG";
+ break;
+ case BW_CS_FLAG_LEVEL_INFO:
+ level_text = "INFO";
+ break;
+ case BW_CS_FLAG_LEVEL_WARN:
+ level_text = "WARN";
+ break;
+ case BW_CS_FLAG_LEVEL_ERROR:
+ level_text = "ERROR";
+ break;
+ default:
+ assert(0 && "Unknown console logging level");
+ level_text = "unknown";
+ break;
+ }
+
+ moutf(MOUT_WINDOW, "CONSOLE_LOG WIN %u SOURCE %s %sFOLDABLE %s %.*s",
+ g->win_num, src_text, foldable ? "" : "NOT-", level_text,
+ (int)msglen, msg);
+}
/**** Handlers ****/
@@ -580,6 +629,8 @@ static struct gui_window_table window_table = {
.new_content = gui_window_new_content,
.start_throbber = gui_window_start_throbber,
.stop_throbber = gui_window_stop_throbber,
+
+ .console_log = gui_window_console_log,
};
struct gui_window_table *monkey_window_table = &window_table;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=0312c45d6f616fdfb6cddabb0689f60a06f86df3
commit 0312c45d6f616fdfb6cddabb0689f60a06f86df3
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Use console_log from browser_window_console_log
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/desktop/browser.c b/desktop/browser.c
index dad830f..3661407 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -3474,6 +3474,8 @@ nserror browser_window_console_log(struct browser_window
*bw,
/* Unreachable */
break;
}
-
+
+ guit->window->console_log(root->window, src, msg, msglen, flags);
+
return NSERROR_OK;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=d24017474174614c630fbfde1c53415cf1a6fdfa
commit d24017474174614c630fbfde1c53415cf1a6fdfa
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Add console_log to gui tables
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index b2b9a3b..5628caa 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -139,6 +139,15 @@ static void gui_default_window_start_selection(struct
gui_window *g)
{
}
+static void
+gui_default_console_log(struct gui_window *gw,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags)
+{
+}
+
/** verify window table is valid */
static nserror verify_window_register(struct gui_window_table *gwt)
@@ -228,6 +237,9 @@ static nserror verify_window_register(struct
gui_window_table *gwt)
if (gwt->start_selection == NULL) {
gwt->start_selection = gui_default_window_start_selection;
}
+ if (gwt->console_log == NULL) {
+ gwt->console_log = gui_default_console_log;
+ }
return NSERROR_OK;
}
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index 53d9b30..8fc7c7b 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -26,6 +26,8 @@
#ifndef NETSURF_WINDOW_H
#define NETSURF_WINDOW_H
+#include "netsurf/console.h"
+
typedef enum gui_save_type {
GUI_SAVE_SOURCE,
GUI_SAVE_DRAW,
@@ -341,6 +343,23 @@ struct gui_window_table {
* \param gw The gui window to start selection in.
*/
void (*start_selection)(struct gui_window *gw);
+
+ /**
+ * console logging happening.
+ *
+ * See \ref browser_window_console_log
+ *
+ * \param gw The gui window receiving the logging.
+ * \param src The source of the logging message
+ * \param msg The text of the logging message
+ * \param msglen The length of the text of the logging message
+ * \param flags Flags associated with the logging.
+ */
+ void (*console_log)(struct gui_window *gw,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags);
};
#endif
-----------------------------------------------------------------------
Summary of changes:
content/handlers/javascript/duktape/Console.bnd | 16 +++----
desktop/browser.c | 7 ++-
desktop/gui_factory.c | 12 +++++
docs/using-monkey.md | 16 +++++--
frontends/monkey/browser.c | 54 +++++++++++++++++++++++
include/netsurf/console.h | 13 +++---
include/netsurf/window.h | 19 ++++++++
7 files changed, 120 insertions(+), 17 deletions(-)
diff --git a/content/handlers/javascript/duktape/Console.bnd
b/content/handlers/javascript/duktape/Console.bnd
index acaab16..cf4bc4f 100644
--- a/content/handlers/javascript/duktape/Console.bnd
+++ b/content/handlers/javascript/duktape/Console.bnd
@@ -89,37 +89,37 @@ method Console::groupEnd ()
method Console::info()
%{
- write_log_entry(ctx, priv->group, 'I');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
method Console::debug()
%{
- write_log_entry(ctx, priv->group, 'D');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_DEBUG);
return 0;
%}
method Console::error()
%{
- write_log_entry(ctx, priv->group, 'E');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_ERROR);
return 0;
%}
method Console::log()
%{
- write_log_entry(ctx, priv->group, 'L');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_LOG);
return 0;
%}
method Console::warn()
%{
- write_log_entry(ctx, priv->group, 'W');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_WARN);
return 0;
%}
method Console::dir()
%{
- write_log_entry(ctx, priv->group, 'd');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
@@ -182,7 +182,7 @@ method Console::timeEnd()
duk_push_string(ctx, "Timer elapsed: ");
duk_insert(ctx, 0);
duk_push_sprintf(ctx, "%lu ms", (duk_uint_t)(time_ms - old_time_ms));
- write_log_entry(ctx, priv->group, 'T');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
@@ -193,6 +193,6 @@ method Console::trace ()
duk_safe_to_string(ctx, -1);
duk_insert(ctx, 0);
duk_set_top(ctx, 1);
- write_log_entry(ctx, priv->group, 'S');
+ write_log_entry(ctx, priv->group, BW_CS_FLAG_LEVEL_INFO);
return 0;
%}
diff --git a/desktop/browser.c b/desktop/browser.c
index dad830f..9795f96 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -3458,6 +3458,9 @@ nserror browser_window_console_log(struct browser_window
*bw,
"unknown input location"));
switch (log_level) {
+ case BW_CS_FLAG_LEVEL_DEBUG:
+ NSLOG(netsurf, DEBUG, "%.*s", (int)msglen, msg);
+ break;
case BW_CS_FLAG_LEVEL_LOG:
NSLOG(netsurf, VERBOSE, "%.*s", (int)msglen, msg);
break;
@@ -3474,6 +3477,8 @@ nserror browser_window_console_log(struct browser_window
*bw,
/* Unreachable */
break;
}
-
+
+ guit->window->console_log(root->window, src, msg, msglen, flags);
+
return NSERROR_OK;
}
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index b2b9a3b..5628caa 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -139,6 +139,15 @@ static void gui_default_window_start_selection(struct
gui_window *g)
{
}
+static void
+gui_default_console_log(struct gui_window *gw,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags)
+{
+}
+
/** verify window table is valid */
static nserror verify_window_register(struct gui_window_table *gwt)
@@ -228,6 +237,9 @@ static nserror verify_window_register(struct
gui_window_table *gwt)
if (gwt->start_selection == NULL) {
gwt->start_selection = gui_default_window_start_selection;
}
+ if (gwt->console_log == NULL) {
+ gwt->console_log = gui_default_console_log;
+ }
return NSERROR_OK;
}
diff --git a/docs/using-monkey.md b/docs/using-monkey.md
index 8d051cf..5e543d6 100644
--- a/docs/using-monkey.md
+++ b/docs/using-monkey.md
@@ -135,9 +135,7 @@ Commands
Cause a browser window to execute some javascript. It won't
work if the window doesn't have a *finished* HTML content.
- This will send a `WINDOW JS WIN` _%id%_ `RET` `TRUE`/`FALSE`
- where `FALSE` indicates that some issue prevented the injection of
- the script.
+ This will send a `JS` message back.
### Login commands
@@ -355,6 +353,18 @@ Responses
The core wraps redraws in these messages. Thus `PLOT` responses can
be allocated to the appropriate window.
+* `WINDOW JS WIN` _%id%_ `RET` `TRUE`/`FALSE`
+
+ Here `FALSE` indicates that some issue prevented the injection of
+ the script.
+
+* `WINDOW CONSOLE_LOG WIN` _%id%_ `SOURCE` _%source%_ _%foldable%_ _%level%_
_%str%_
+
+ Here, _%source%_ will be one of: `client-input`, `scripting-error`, or
+ `scripting-console`. _%foldable%_ will be one of `FOLDABLE` or
+ `NOT-FOLDABLE`. _%level%_ will be one of `LOG`, `INFO`, `WARN`, or
+ `ERROR`. The terminal string will be the log message.
+
### Download window messages
* `DOWNLOAD CREATE DWIN` _%id%_ `WIN` _%id%_
diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c
index 50b586f..b7aea92 100644
--- a/frontends/monkey/browser.c
+++ b/frontends/monkey/browser.c
@@ -350,7 +350,59 @@ gui_window_save_link(struct gui_window *g, nsurl *url,
const char *title)
return NSERROR_OK;
}
+static void
+gui_window_console_log(struct gui_window *g,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags)
+{
+ bool foldable = !!(flags & BW_CS_FLAG_FOLDABLE);
+ const char *src_text;
+ const char *level_text;
+
+ switch (src) {
+ case BW_CS_INPUT:
+ src_text = "client-input";
+ break;
+ case BW_CS_SCRIPT_ERROR:
+ src_text = "scripting-error";
+ break;
+ case BW_CS_SCRIPT_CONSOLE:
+ src_text = "scripting-console";
+ break;
+ default:
+ assert(0 && "Unknown scripting source");
+ src_text = "unknown";
+ break;
+ }
+
+ switch (flags & BW_CS_FLAG_LEVEL_MASK) {
+ case BW_CS_FLAG_LEVEL_DEBUG:
+ level_text = "DEBUG";
+ break;
+ case BW_CS_FLAG_LEVEL_LOG:
+ level_text = "LOG";
+ break;
+ case BW_CS_FLAG_LEVEL_INFO:
+ level_text = "INFO";
+ break;
+ case BW_CS_FLAG_LEVEL_WARN:
+ level_text = "WARN";
+ break;
+ case BW_CS_FLAG_LEVEL_ERROR:
+ level_text = "ERROR";
+ break;
+ default:
+ assert(0 && "Unknown console logging level");
+ level_text = "unknown";
+ break;
+ }
+ moutf(MOUT_WINDOW, "CONSOLE_LOG WIN %u SOURCE %s %sFOLDABLE %s %.*s",
+ g->win_num, src_text, foldable ? "" : "NOT-", level_text,
+ (int)msglen, msg);
+}
/**** Handlers ****/
@@ -580,6 +632,8 @@ static struct gui_window_table window_table = {
.new_content = gui_window_new_content,
.start_throbber = gui_window_start_throbber,
.stop_throbber = gui_window_stop_throbber,
+
+ .console_log = gui_window_console_log,
};
struct gui_window_table *monkey_window_table = &window_table;
diff --git a/include/netsurf/console.h b/include/netsurf/console.h
index 31ed0e7..dead3fd 100644
--- a/include/netsurf/console.h
+++ b/include/netsurf/console.h
@@ -49,16 +49,19 @@ typedef enum {
*/
BW_CS_FLAG_FOLDABLE = 1 << 0,
+ /** Logged at the 'debug' level, please use only one of the LEVEL flags
*/
+ BW_CS_FLAG_LEVEL_DEBUG = 0 << 1,
/** Logged at the 'log' level, please only use one of the LEVEL flags */
- BW_CS_FLAG_LEVEL_LOG = 0 << 1,
+ BW_CS_FLAG_LEVEL_LOG = 1 << 1,
/** Logged at the 'info' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_INFO = 1 << 1,
+ BW_CS_FLAG_LEVEL_INFO = 2 << 1,
/** Logged at the 'warn' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_WARN = 2 << 1,
+ BW_CS_FLAG_LEVEL_WARN = 3 << 1,
/** Logged at the 'error' level, please use only one of the LEVEL flags
*/
- BW_CS_FLAG_LEVEL_ERROR = 3 << 1,
+ BW_CS_FLAG_LEVEL_ERROR = 4 << 1,
+ /* Levels 5, 6, 7 unused as yet */
/** Mask for the error level to allow easy comparison using the above */
- BW_CS_FLAG_LEVEL_MASK = 3 << 1,
+ BW_CS_FLAG_LEVEL_MASK = 7 << 1,
} browser_window_console_flags;
#endif /* _NETSURF_CONSOLE_H_ */
diff --git a/include/netsurf/window.h b/include/netsurf/window.h
index 53d9b30..8fc7c7b 100644
--- a/include/netsurf/window.h
+++ b/include/netsurf/window.h
@@ -26,6 +26,8 @@
#ifndef NETSURF_WINDOW_H
#define NETSURF_WINDOW_H
+#include "netsurf/console.h"
+
typedef enum gui_save_type {
GUI_SAVE_SOURCE,
GUI_SAVE_DRAW,
@@ -341,6 +343,23 @@ struct gui_window_table {
* \param gw The gui window to start selection in.
*/
void (*start_selection)(struct gui_window *gw);
+
+ /**
+ * console logging happening.
+ *
+ * See \ref browser_window_console_log
+ *
+ * \param gw The gui window receiving the logging.
+ * \param src The source of the logging message
+ * \param msg The text of the logging message
+ * \param msglen The length of the text of the logging message
+ * \param flags Flags associated with the logging.
+ */
+ void (*console_log)(struct gui_window *gw,
+ browser_window_console_source src,
+ const char *msg,
+ size_t msglen,
+ browser_window_console_flags flags);
};
#endif
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org