Bindings - move log wrappers into the swig interface files

They are only used for guile (and possibly python, so there's
no need to carry them around in core-utils.
This commit is contained in:
Geert Janssens 2021-03-17 15:04:02 +01:00 committed by John Ralls
parent e5c6f6026b
commit 7765e13704
5 changed files with 13 additions and 43 deletions

View File

@ -90,11 +90,6 @@ gchar * gnc_build_stdreports_path(const gchar *);
%newobject gnc_build_reports_path;
gchar * gnc_build_reports_path(const gchar *);
void gnc_scm_log_warn(const gchar *);
void gnc_scm_log_error(const gchar *);
void gnc_scm_log_msg(const gchar *);
void gnc_scm_log_debug(const gchar *);
%newobject gnc_utf8_strip_invalid_strdup;
gchar * gnc_utf8_strip_invalid_strdup(const gchar *);

View File

@ -111,6 +111,15 @@ engine-common.i */
%include "qoflog.h"
%inline %{
static void gnc_log_warn(const char *msg)
{ g_log("gnc.scm", G_LOG_LEVEL_WARNING, "%s", msg); }
static void gnc_log_error(const char *msg)
{ g_log("gnc.scm", G_LOG_LEVEL_CRITICAL, "%s", msg); }
static void gnc_log_msg(const char *msg)
{ g_log("gnc.scm", G_LOG_LEVEL_MESSAGE, "%s", msg); }
static void gnc_log_debug(const char *msg)
{ g_log("gnc.scm", G_LOG_LEVEL_DEBUG, "%s", msg); }
static const GncGUID * gncPriceGetGUID(GNCPrice *x)
{ return qof_instance_get_guid(QOF_INSTANCE(x)); }
static const GncGUID * gncBudgetGetGUID(GncBudget *x)

View File

@ -40,17 +40,17 @@
(string-join (map (lambda (x) (format #f "~A" x)) items) ""))
(define (gnc:warn . items)
(gnc-scm-log-warn (strify items)))
(gnc-log-warn (strify items)))
(define (gnc:error . items)
(gnc-scm-log-error (strify items )))
(gnc-log-error (strify items )))
(define (gnc:msg . items)
(gnc-scm-log-msg (strify items)))
(gnc-log-msg (strify items)))
(define (gnc:debug . items)
(when (qof-log-check "gnc.scm" QOF-LOG-DEBUG)
(gnc-scm-log-debug (strify items))))
(gnc-log-debug (strify items))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the following functions are initialized to log message to tracefile

View File

@ -287,30 +287,6 @@ gnc_g_list_cut(GList **list, GList *cut_point)
cut_point->prev = NULL;
}
void
gnc_scm_log_warn(const gchar *msg)
{
g_log("gnc.scm", G_LOG_LEVEL_WARNING, "%s", msg);
}
void
gnc_scm_log_error(const gchar *msg)
{
g_log("gnc.scm", G_LOG_LEVEL_CRITICAL, "%s", msg);
}
void
gnc_scm_log_msg(const gchar *msg)
{
g_log("gnc.scm", G_LOG_LEVEL_MESSAGE, "%s", msg);
}
void
gnc_scm_log_debug(const gchar *msg)
{
g_log("gnc.scm", G_LOG_LEVEL_DEBUG, "%s", msg);
}
gchar *
gnc_g_list_stringjoin (GList *list_of_strings, const gchar *sep)

View File

@ -169,16 +169,6 @@ void gnc_g_list_cut(GList **list, GList *cut_point);
/** @} */
/** @name Message Logging
@{
*/
void gnc_scm_log_warn(const gchar *msg);
void gnc_scm_log_error(const gchar *msg);
void gnc_scm_log_msg(const gchar *msg);
void gnc_scm_log_debug(const gchar *msg);
/** @} */
/**
* @brief Return a string joining a GList whose elements are gchar*