grl-log: Grilo Reference Manual

## grl-log grl-log — Log system |

## Functions

#define | GRL_LOG()
#define | GRL_LOG_DOMAIN()
#define | GRL_LOG_DOMAIN_EXTERN()
#define | GRL_LOG_DOMAIN_FREE()
#define | GRL_LOG_DOMAIN_INIT()
#define | GRL_LOG_DOMAIN_STATIC()
#define | GRL_DEBUG()
#define | GRL_ERROR()
#define | GRL_INFO()
#define | GRL_MESSAGE()
#define | GRL_WARNING()
void | grl_log ()
void | grl_log_configure ()
void | grl_log_domain_free ()
GrlLogDomain * | grl_log_domain_new ()

## Types and Values

| GrlLogDomain
enum | GrlLogLevel
extern GrlLogDomain * | GRL_LOG_DOMAIN_DEFAULT

## Includes

    #include <grilo.h>

## Description

This class stores information related to the log system

## Functions

### GRL_LOG()

    #define             GRL_LOG(domain, level, ...)

Outputs a debugging message. This is the most general macro for outputting debugging messages. You will probably want to use one of the ones described below.

#### Parameters

domain | the log domain to use |
level | the severity of the message |
... | A printf-style message to output |

### GRL_LOG_DOMAIN()

    #define GRL_LOG_DOMAIN(domain) GrlLogDomain *domain = NULL

Defines a GrlLogDomain variable.

#### Parameters

domain | the log domain |

### GRL_LOG_DOMAIN_EXTERN()

    #define GRL_LOG_DOMAIN_EXTERN(domain) extern GrlLogDomain *domain

Declares a GrlLogDomain variable as extern. Use in header files.

#### Parameters

domain | the log domain |

### GRL_LOG_DOMAIN_FREE()

    #define             GRL_LOG_DOMAIN_FREE(domain)

Free a previously allocated GrlLogDomain.

#### Parameters

domain | the log domain to free. |

### GRL_LOG_DOMAIN_INIT()

    #define             GRL_LOG_DOMAIN_INIT(domain, name)

Creates a new GrlLogDomain with the given name.

#### Parameters

domain | the log domain to initialize. |
name | the name of the log domain. |

### GRL_LOG_DOMAIN_STATIC()

    #define GRL_LOG_DOMAIN_STATIC(domain) static GrlLogDomain *domain = NULL

Defines a static GrlLogDomain variable.

#### Parameters

domain | the log domain |

### GRL_DEBUG()

    #define             GRL_DEBUG(...)

Output a debugging message in the default log domain.

#### Parameters

... | printf-style message to output |

### GRL_ERROR()

    #define             GRL_ERROR(...)

Output an error message in the default log domain.

#### Parameters

... | printf-style message to output |

### GRL_INFO()

    #define             GRL_INFO(...)

Output an informational message in the default log domain.

#### Parameters

... | printf-style message to output |

### GRL_MESSAGE()

    #define             GRL_MESSAGE(...)

Output a logging message in the default log domain.

#### Parameters

... | printf-style message to output |

### GRL_WARNING()

    #define             GRL_WARNING(...)

Output a warning message in the default log domain.

#### Parameters

... | printf-style message to output |

### grl_log ()

    void
    grl_log (GrlLogDomain *domain,
             GrlLogLevel level,
             const gchar *strloc,
             const gchar *format,
             ...);

Send a log message.

#### Parameters

domain | a domain |
level | log level |
strloc | string, usually line of code where function is invoked |
format | log message |
... | parameters to insert in the log message |

Since: 0.1.7

### grl_log_configure ()

    void
    grl_log_configure (const gchar *config);

Configure a set of log domains. The default configuration is to display warning and error messages only for all the log domains.

The configuration string follows the following grammar:

    1
    2
    3
    4
    5
    6
    config-list: config | config ',' config-list
    config: domain ':' level
    domain: '*' | [a-zA-Z0-9]+
    level: '*' | '-' | named-level | num-level
    named-level: "none" | "error" | "warning" | "message" | "info" | "debug"
    num-level: [0-5]

examples:

- "*:*": maximum verbosity for all the log domains

- "*:-": don't print any message

- "media-source:debug,metadata-source:debug": prints debug, info, message warning and error messages for the media-source and metadata-source log domains

It's possible to override the log configuration at runtime by defining the GRL_DEBUG environment variable to a configuration string as described above

#### Parameters

config | A string describing the wanted log configuration |

Since: 0.1.7

### grl_log_domain_free ()

    void
    grl_log_domain_free (GrlLogDomain *domain);

Releases `domain` .

#### Parameters

domain | a GrlLogDomain |

Since: 0.1.7

### grl_log_domain_new ()

    GrlLogDomain *
    grl_log_domain_new (const gchar *name);

[skip]

#### Parameters

name | The name for the new log domain |

#### Returns

The new log domain

Since: 0.1.7

## Types and Values

### GrlLogDomain

    typedef struct _GrlLogDomain GrlLogDomain;

### enum GrlLogLevel

Grilo log levels. Defines the level of verbosity selected in Grilo.

#### Members

GRL_LOG_LEVEL_NONE | Log level none |
GRL_LOG_LEVEL_ERROR | Log on error |
GRL_LOG_LEVEL_WARNING | Log on warning |
GRL_LOG_LEVEL_MESSAGE | Log on message |
GRL_LOG_LEVEL_INFO | Log on info |
GRL_LOG_LEVEL_DEBUG | Log on debug |
GRL_LOG_LEVEL_LAST | Last level of log |

### GRL_LOG_DOMAIN_DEFAULT

    extern GrlLogDomain *GRL_LOG_DOMAIN_DEFAULT;