From f21700e00e81538d5510973a51b8ae97fb4a24dd Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 17:12:42 +0100 Subject: Enable logging to Matlab window using callback function Also introduces a mex initialize function that is called at the first invocation of any mex method. --- include/astra/Logging.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/astra/Logging.h') diff --git a/include/astra/Logging.h b/include/astra/Logging.h index 5695663..e822c24 100644 --- a/include/astra/Logging.h +++ b/include/astra/Logging.h @@ -75,7 +75,7 @@ public: * @param ... * Any additional format arguments. */ - static void debug(const char *sfile, int sline, const char *fmt, ...); + static void debug(const char *sfile, int sline, const char *fmt, ...); static void info(const char *sfile, int sline, const char *fmt, ...); static void warn(const char *sfile, int sline, const char *fmt, ...); static void error(const char *sfile, int sline, const char *fmt, ...); @@ -143,6 +143,13 @@ public: static void disableScreen(); static void disableFile(); + /** + * Set callback function for logging to screen. + * @return whether callback was set succesfully. + * + */ + static bool setCallbackScreen(void (*cb)(const char *msg, size_t len)); + }; } -- cgit v1.2.3