~ubuntu-branches/ubuntu/raring/grilo/raring

« back to all changes in this revision

Viewing changes to src/grl-log.c

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Garcia
  • Date: 2011-07-02 13:48:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110702134846-u10hi90nwf6wf3v0
Tags: 0.1.16-1
* New upstream release.
* debian/{grl-inspect.1,libgrilo-0.1-0.manpages,libgrilo-0.1-0.install}:
  use manpage shipped by upstream.
* debian/libgrilo-0.1-0.shlibs: new API, bump shlibs to 0.1.16.
* debian/copyright: Author(s) => Authors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
static GSList *log_domains = NULL;  /* the list of GrlLogDomain's */
49
49
 
50
50
/* Catch all log domain */
 
51
/* For clarity, it should not be re-#define'd in this file, code that wants to
 
52
 * log things with log_log_domain should do it explicitly using GRL_LOG(),
 
53
 * instead of using GRL_{DEBUG,INFO,MESSAGE,WARNING,ERROR}() */
51
54
GRL_LOG_DOMAIN(GRL_LOG_DOMAIN_DEFAULT);
52
55
 
53
 
#define GRL_LOG_DOMAIN_DEFAULT  log_log_domain
54
56
GRL_LOG_DOMAIN(log_log_domain);
55
57
 
56
58
static GrlLogDomain *
73
75
{
74
76
  GrlLogDomain *domain;
75
77
 
76
 
  if (*name == '\0')
 
78
  if (*name == '\0' && GRL_LOG_DOMAIN_DEFAULT != NULL)
77
79
    return GRL_LOG_DOMAIN_DEFAULT;
78
80
 
79
81
  domain = g_slice_new (GrlLogDomain);
82
84
 
83
85
  log_domains = g_slist_prepend (log_domains, domain);
84
86
 
 
87
  if (*name == '\0' && GRL_LOG_DOMAIN_DEFAULT == NULL)
 
88
    /* Ensure GRL_LOG_DOMAIN_DEFAULT is set. */
 
89
    GRL_LOG_DOMAIN_DEFAULT = domain;
 
90
 
85
91
  return domain;
86
92
}
87
93
 
246
252
 
247
253
      domain->log_level = level;
248
254
 
249
 
      GRL_DEBUG ("domain: '%s', level: '%s'", domain_spec, level_spec);
 
255
      GRL_LOG (log_log_domain, GRL_LOG_LEVEL_DEBUG,
 
256
               "domain: '%s', level: '%s'", domain_spec, level_spec);
250
257
 
251
258
      g_strfreev (pair_info);
252
259
    } else {
253
 
      GRL_WARNING ("Invalid log spec: '%s'", *pair);
 
260
      GRL_LOG (log_log_domain, GRL_LOG_LEVEL_WARNING,
 
261
               "Invalid log spec: '%s'", *pair);
254
262
    }
255
263
    pair++;
256
264
  }
329
337
   * verbosity */
330
338
  log_env = g_getenv ("GRL_DEBUG");
331
339
  if (log_env) {
332
 
    GRL_DEBUG ("Using log configuration from GRL_DEBUG: %s", log_env);
 
340
    GRL_LOG (log_log_domain, GRL_LOG_LEVEL_DEBUG,
 
341
             "Using log configuration from GRL_DEBUG: %s", log_env);
333
342
    configure_log_domains (log_env);
334
343
    grl_log_env = g_strsplit (log_env, ",", 0);
335
344
  }