6 Mar 10:43
MidgardConnection (Was: [midgard-cvs] CVS update: /midgard/src/core/midgard/midgard/)
Hi, Changing the subject to a bit more descriptive one.On 3/6/06, Piotras <pp <at> infoglob.com> wrote: > I would like to propose a simple convention. > What's GObject in core is designed for language binding, while what isn't GObject > should be used only in core. I wouldn't be that strict. Use what best suits the requirements. Using GObjects is no magic dust to make language bindings easy, GObjects just provide a standard set of features (properties, signals, data attachments, inheritance, introspection, etc.) that is well supported in a variety of environments. Using GObjects for stuff that doesn't need those features (for example MidgardConnection doesn't really need generic properties or introspection, but signals and data attachments might be nice) is just extra work. > > a) use g_log_set_default_handler() to handle log messages from > > *all* log domains, or > > Yeah, but this is GLib 2.6 :/ You're already using it in src/config.c. In any case we shouldn't be using either of the g_log_set functions in midgard-core. If an application wants to use g_log_set_default_handler(), it should require GLib 2.6. > OK, help me with real issue now. > While you use repligard in HEAD you use "repligard" G_LOG_DOMAIN , while core > has "midgard-core" and "midgard-lib" defined. > What should I do to make core "silent" instead of logging *everything* ? > Without g_log_set_default_handler(). Simple mechanism to silence midgard-core: static void null_log_handler( const gchar *domain, GLogLevelFlags log_level, const gchar *message, gpointer data) { /* do nothing */ } g_log_set_handler( MIDGARD_LOG_HANDLER, G_LOG_LEVEL_MASK, null_log_handler, NULL); We should replace all explicit "midgard-lib" and "midgard-core" log domains strings in midgard-core with G_LOG_DOMAIN. > Coming back to lang and sitegroup GValues issue. > What do you think about such changes: > extern void midgard_connection_sitegroup_set(MidgardConnection *mgd, GValue *value); > to > extern void midgard_connection_sitegroup_set(MidgardConnection *mgd, MidgardSitegroup *sitegroup); > and similiar: > extern gboolean midgard_connection_set_lang(MidgardConnection *connection, MidgardLanguage *language); Depends on what MidgardSitegroup and MidgardLanguage are... BR, Jukka Zitting -- Yukatan - http://yukatan.fi/ - info <at> yukatan.fi Software craftsmanship, JCR consulting, and Java development
On 3/6/06, Piotras <pp <at> infoglob.com> wrote:
> I would like to propose a simple convention.
> What's GObject in core is designed for language binding, while what isn't GObject
> should be used only in core.
I wouldn't be that strict. Use what best suits the requirements. Using
GObjects is no magic dust to make language bindings easy, GObjects
just provide a standard set of features (properties, signals, data
attachments, inheritance, introspection, etc.) that is well supported
in a variety of environments. Using GObjects for stuff that doesn't
need those features (for example MidgardConnection doesn't really need
generic properties or introspection, but signals and data attachments
might be nice) is just extra work.
> > a) use g_log_set_default_handler() to handle log messages from
> > *all* log domains, or
>
> Yeah, but this is GLib 2.6 :/
You're already using it in src/config.c. In any case we shouldn't be
using either of the g_log_set functions in midgard-core. If an
application wants to use g_log_set_default_handler(), it should
require GLib 2.6.
> OK, help me with real issue now.
> While you use repligard in HEAD you use "repligard" G_LOG_DOMAIN , while core
> has "midgard-core" and "midgard-lib" defined.
> What should I do to make core "silent" instead of logging *everything* ?
> Without g_log_set_default_handler().
Simple mechanism to silence midgard-core:
static void null_log_handler(
const gchar *domain, GLogLevelFlags log_level,
const gchar *message, gpointer data) {
/* do nothing */
}
g_log_set_handler(
MIDGARD_LOG_HANDLER, G_LOG_LEVEL_MASK,
null_log_handler, NULL);
We should replace all explicit "midgard-lib" and "midgard-core" log
domains strings in midgard-core with G_LOG_DOMAIN.
> Coming back to lang and sitegroup GValues issue.
> What do you think about such changes:
> extern void midgard_connection_sitegroup_set(MidgardConnection *mgd, GValue *value);
> to
> extern void midgard_connection_sitegroup_set(MidgardConnection *mgd, MidgardSitegroup *sitegroup);
> and similiar:
> extern gboolean midgard_connection_set_lang(MidgardConnection *connection, MidgardLanguage *language);
Depends on what MidgardSitegroup and MidgardLanguage are...
BR,
Jukka Zitting
--
Yukatan -
RSS Feed