libgxim Reference Manual | ||||
---|---|---|---|---|
#define g_xim_message_gerror (_i_,_e_) #define g_xim_message (_i_,_f_,...) #define g_xim_message_info (_i_,_f_,...) #define g_xim_message_warning (_i_,...) #define g_xim_message_error (_i_,...) #define g_xim_message_critical (_i_,...) #define g_xim_message_debug (_i_,_f_,...) #define g_xim_message_bug (_i_,...) enum GXimMessageType; GXimMessage; GXimMessage* g_xim_message_new (void); void g_xim_message_activate (GXimMessage *message, gboolean flag); void g_xim_message_set_filename (GXimMessage *message, const gchar *filename); void g_xim_message_clear_filter (GXimMessage *message); void g_xim_message_enable_filter (GXimMessage *message, const gchar *filter_name); void g_xim_message_vprintf (GXimMessage *message, const gchar *filter, GXimMessageType type, const gchar *format, va_list args); void g_xim_message_printf (GXimMessage *message, const gchar *filter, GXimMessageType type, const gchar *format, ...);
"activated" : Run Last "created" : Run First "filename-changed" : Run Last "filter-added" : Run Last "filter-cleared" : Run Last
GXimMessage provides a logging facility. this allows you to output messages any time you want. you can manage it with DBus as well. so you don't even restart processes then.
Right now the following signals are available to manage the logging facility. you can emits signals any time as following:
Example 1.
$ dbus-send --session --type=signal /org/tagoh/libgxim org.tagoh.libgxim.SignalName type:value
SignalName will be replaced with following signal names. See manpage for dbus-send to learn usage for others.
Activate |
Sets the activity of the logging facility. a boolean value is required as a parameter. See |
SetFilename |
Sets the filename to be logged messages into. a string value is required as a parameter. See |
RemoveAllFilters |
Resets filters to output. See |
AddFilter |
Adds a filter which you want to see a message. a string value is required as a parameter. See |
#define g_xim_message_gerror(_i_,_e_)
Outputs a GError with g_xim_message_printf()
.
This is a convenience macro to output a message. the message type depends on the error code which would be logically added with GXimErrorType.
|
a GXimMessage. |
|
a GError to output. |
#define g_xim_message(_i_,_f_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_MESSAGE
.
|
a GXimMessage. |
|
a unique filter name. |
|
#define g_xim_message_info(_i_,_f_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_INFO
.
|
a GXimMessage. |
|
a unique filter name. |
|
#define g_xim_message_warning(_i_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_WARNING
.
|
a GXimMessage. |
|
#define g_xim_message_error(_i_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_ERROR
.
|
a GXimMessage. |
|
#define g_xim_message_critical(_i_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_CRITICAL
.
|
a GXimMessage. |
|
#define g_xim_message_debug(_i_,_f_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_DEBUG
.
|
a GXimMessage. |
|
a unique filter name. |
|
#define g_xim_message_bug(_i_,...)
Outputs a message with g_xim_message_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGE_BUG
.
|
a GXimMessage. |
|
typedef enum { G_XIM_MESSAGE_MESSAGE, G_XIM_MESSAGE_DEBUG, G_XIM_MESSAGE_INFO, G_XIM_MESSAGE_WARNING, G_XIM_MESSAGE_ERROR, G_XIM_MESSAGE_CRITICAL, G_XIM_MESSAGE_BUG } GXimMessageType;
Flags specifying the type of messages.
a message type for usual messages, see g_xim_message() .
|
|
a message type for debug, see g_xim_message_debug() .
|
|
a message type for information, see g_xim_message_info() .
|
|
a message type for warnings, see g_xim_message_warning() .
|
|
a message type for errors, see g_xim_message_error() .
|
|
a message type for critical errors, see g_xim_message_critical() .
|
|
a message type for bugs, see g_xim_message_bug() .
|
GXimMessage* g_xim_message_new (void);
Creates an instance to provide you a logging facility. when an instance is created, GXimMessage::created signal will be emitted.
Returns : |
a GXimMessage. |
void g_xim_message_activate (GXimMessage *message, gboolean flag);
Sets the activity of the logging facility.
This affects all of the instance of GXimMessage in the process.
|
a GXimMessage. |
|
TRUE to enable logging. FALSE to disable logging.
|
void g_xim_message_set_filename (GXimMessage *message, const gchar *filename);
Sets the filename.
This affects all of the instance of GXimMessage in the process.
|
a GXimMessage. |
|
the filename to be logged a message into. |
void g_xim_message_clear_filter (GXimMessage *message);
Resets all of the filters you wanted to allow a message.
This affects all of the instance of GXimMessage in the process.
|
a GXimMessage. |
void g_xim_message_enable_filter (GXimMessage *message, const gchar *filter_name);
Allows logging a message categorized to filter_name
. "all" and "noall"
filter name is reserved. "all" to enable all of filters no matter what
filters are enabled. "noall" to enable filters specified by this function.
This affects all of the instance of GXimMessage in the process.
|
a GXimMessage. |
|
a unique filter name to be categorized. |
void g_xim_message_vprintf (GXimMessage *message, const gchar *filter, GXimMessageType type, const gchar *format, va_list args);
Outputs a message. when G_XIM_MESSAGE_WARNING
, G_XIM_MESSAGE_ERROR
,
G_XIM_MESSAGE_CRITICAL
or G_XIM_MESSAGE_BUG
is specified to type
,
a message will be output regardless of what filter is given to filter
.
Otherwise if filter
isn't enabled, this just will be ignored.
|
a GXimMessage. |
|
a unique filter name to be categorized. |
|
an urgency of the message. |
|
the message format. See the printf() documentation.
|
|
a va_list. |
void g_xim_message_printf (GXimMessage *message, const gchar *filter, GXimMessageType type, const gchar *format, ...);
Outputs a message. when G_XIM_MESSAGE_WARNING
, G_XIM_MESSAGE_ERROR
,
G_XIM_MESSAGE_CRITICAL
or G_XIM_MESSAGE_BUG
is specified to type
,
a message will be output regardless of what filter is given to filter
.
Otherwise if filter
isn't enabled, this just will be ignored.
|
a GXimMessage. |
|
a unique filter name to be categorized. |
|
an urgency of the message. |
|
the message format. See the printf() documentation.
|
|
"all-filters"
property"all-filters" gboolean : Read / Write
TRUE
to enable all of the message filters. FALSE
to deal with each filters added by "filter-added" signal.
Default value: FALSE
"master"
property"master" gboolean : Read / Write
TRUE
to be a master instance of GXimMessage. FALSE
to be a slave instance of GXimMessage.
Default value: FALSE
"activated"
signalgboolean user_function (GXimMessage *message, gboolean flag, gpointer user_data) : Run Last
The ::activated signal will be emitted when someone calls
g_xim_message_activate()
or when someone emits Activate signal
through DBus.
"created"
signalvoid user_function (GXimMessage *message, GXimMessage *created_object, gpointer user_data) : Run First
The ::created signal will be emitted when an instance of GXimMessage is created. the master object only receives this signal.
|
the object which received the signal. |
|
a GXimMessage which newly created somewhere in the process. |
|
user data set when the signal handler was connected. |
"filename-changed"
signalgboolean user_function (GXimMessage *message, gchar *filename, gpointer user_data) : Run Last
The ::filename-changed signal will be emitted when someone calls
g_xim_message_set_filename()
or when someone emits SetFilename signal
through DBus.
"filter-added"
signalgboolean user_function (GXimMessage *message, gchar *filter, gpointer user_data) : Run Last
The ::filter-added signal will be emitted when someone calls
g_xim_message_enable_filter()
or when someone emits AddFilter signal
through DBus.
"filter-cleared"
signalgboolean user_function (GXimMessage *message, gpointer user_data) : Run Last
The ::filter-cleared signal will be emitted when someone calls
g_xim_message_clear_filter()
or when someone emits RemoveAllFilters
signal through DBus.