/usr/include/d/gtkd-3/glib/MessageLog.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module glib.MessageLog;
private import glib.Str;
private import glib.c.functions;
public import glib.c.types;
public import gtkc.glibtypes;
/** */
public struct MessageLog
{
/**
* The default log handler set up by GLib; g_log_set_default_handler()
* allows to install an alternate default log handler.
* This is used if no log handler has been set for the particular log
* domain and log level combination. It outputs the message to stderr
* or stdout and if the log level is fatal it calls abort(). It automatically
* prints a new-line character after the message, so one does not need to be
* manually included in @message.
*
* The behavior of this log handler can be influenced by a number of
* environment variables:
*
* - `G_MESSAGES_PREFIXED`: A :-separated list of log levels for which
* messages should be prefixed by the program name and PID of the
* aplication.
*
* - `G_MESSAGES_DEBUG`: A space-separated list of log domains for
* which debug and informational messages are printed. By default
* these messages are not printed.
*
* stderr is used for levels %G_LOG_LEVEL_ERROR, %G_LOG_LEVEL_CRITICAL,
* %G_LOG_LEVEL_WARNING and %G_LOG_LEVEL_MESSAGE. stdout is used for
* the rest.
*
* This has no effect if structured logging is enabled; see
* [Using Structured Logging][using-structured-logging].
*
* Params:
* logDomain = the log domain of the message, or %NULL for the
* default "" application domain
* logLevel = the level of the message
* message = the message
* unusedData = data passed from g_log() which is unused
*/
public static void logDefaultHandler(string logDomain, GLogLevelFlags logLevel, string message, void* unusedData)
{
g_log_default_handler(Str.toStringz(logDomain), logLevel, Str.toStringz(message), unusedData);
}
/**
* Removes the log handler.
*
* This has no effect if structured logging is enabled; see
* [Using Structured Logging][using-structured-logging].
*
* Params:
* logDomain = the log domain
* handlerId = the id of the handler, which was returned
* in g_log_set_handler()
*/
public static void logRemoveHandler(string logDomain, uint handlerId)
{
g_log_remove_handler(Str.toStringz(logDomain), handlerId);
}
/**
* Sets the message levels which are always fatal, in any log domain.
* When a message with any of these levels is logged the program terminates.
* You can only set the levels defined by GLib to be fatal.
* %G_LOG_LEVEL_ERROR is always fatal.
*
* You can also make some message levels fatal at runtime by setting
* the `G_DEBUG` environment variable (see
* [Running GLib Applications](glib-running.html)).
*
* Libraries should not call this function, as it affects all messages logged
* by a process, including those from other libraries.
*
* Structured log messages (using g_log_structured() and
* g_log_structured_array()) are fatal only if the default log writer is used;
* otherwise it is up to the writer function to determine which log messages
* are fatal. See [Using Structured Logging][using-structured-logging].
*
* Params:
* fatalMask = the mask containing bits set for each level
* of error which is to be fatal
*
* Returns: the old fatal mask
*/
public static GLogLevelFlags logSetAlwaysFatal(GLogLevelFlags fatalMask)
{
return g_log_set_always_fatal(fatalMask);
}
/**
* Installs a default log handler which is used if no
* log handler has been set for the particular log domain
* and log level combination. By default, GLib uses
* g_log_default_handler() as default log handler.
*
* This has no effect if structured logging is enabled; see
* [Using Structured Logging][using-structured-logging].
*
* Params:
* logFunc = the log handler function
* userData = data passed to the log handler
*
* Returns: the previous default log handler
*
* Since: 2.6
*/
public static GLogFunc logSetDefaultHandler(GLogFunc logFunc, void* userData)
{
return g_log_set_default_handler(logFunc, userData);
}
/**
* Sets the log levels which are fatal in the given domain.
* %G_LOG_LEVEL_ERROR is always fatal.
*
* This has no effect on structured log messages (using g_log_structured() or
* g_log_structured_array()). To change the fatal behaviour for specific log
* messages, programs must install a custom log writer function using
* g_log_set_writer_func(). See
* [Using Structured Logging][using-structured-logging].
*
* Params:
* logDomain = the log domain
* fatalMask = the new fatal mask
*
* Returns: the old fatal mask for the log domain
*/
public static GLogLevelFlags logSetFatalMask(string logDomain, GLogLevelFlags fatalMask)
{
return g_log_set_fatal_mask(Str.toStringz(logDomain), fatalMask);
}
/**
* Sets the log handler for a domain and a set of log levels.
* To handle fatal and recursive messages the @log_levels parameter
* must be combined with the #G_LOG_FLAG_FATAL and #G_LOG_FLAG_RECURSION
* bit flags.
*
* Note that since the #G_LOG_LEVEL_ERROR log level is always fatal, if
* you want to set a handler for this log level you must combine it with
* #G_LOG_FLAG_FATAL.
*
* This has no effect if structured logging is enabled; see
* [Using Structured Logging][using-structured-logging].
*
* Here is an example for adding a log handler for all warning messages
* in the default domain:
* |[<!-- language="C" -->
* g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
*
* This example adds a log handler for all critical messages from GTK+:
* |[<!-- language="C" -->
* g_log_set_handler ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
*
* This example adds a log handler for all messages from GLib:
* |[<!-- language="C" -->
* g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
* | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
* ]|
*
* Params:
* logDomain = the log domain, or %NULL for the default ""
* application domain
* logLevels = the log levels to apply the log handler for.
* To handle fatal and recursive messages as well, combine
* the log levels with the #G_LOG_FLAG_FATAL and
* #G_LOG_FLAG_RECURSION bit flags.
* logFunc = the log handler function
* userData = data passed to the log handler
*
* Returns: the id of the new handler
*/
public static uint logSetHandler(string logDomain, GLogLevelFlags logLevels, GLogFunc logFunc, void* userData)
{
return g_log_set_handler(Str.toStringz(logDomain), logLevels, logFunc, userData);
}
/**
* Like g_log_sets_handler(), but takes a destroy notify for the @user_data.
*
* This has no effect if structured logging is enabled; see
* [Using Structured Logging][using-structured-logging].
*
* Params:
* logDomain = the log domain, or %NULL for the default ""
* application domain
* logLevels = the log levels to apply the log handler for.
* To handle fatal and recursive messages as well, combine
* the log levels with the #G_LOG_FLAG_FATAL and
* #G_LOG_FLAG_RECURSION bit flags.
* logFunc = the log handler function
* userData = data passed to the log handler
* destroy = destroy notify for @user_data, or %NULL
*
* Returns: the id of the new handler
*
* Since: 2.46
*/
public static uint logSetHandlerFull(string logDomain, GLogLevelFlags logLevels, GLogFunc logFunc, void* userData, GDestroyNotify destroy)
{
return g_log_set_handler_full(Str.toStringz(logDomain), logLevels, logFunc, userData, destroy);
}
/**
* Logs an error or debugging message.
*
* If the log level has been set as fatal, the abort()
* function is called to terminate the program.
*
* If g_log_default_handler() is used as the log handler function, a new-line
* character will automatically be appended to @..., and need not be entered
* manually.
*
* If [structured logging is enabled][using-structured-logging] this will
* output via the structured log writer function (see g_log_set_writer_func()).
*
* Params:
* logDomain = the log domain, or %NULL for the default ""
* application domain
* logLevel = the log level
* format = the message format. See the printf() documentation
* args = the parameters to insert into the format string
*/
public static void logv(string logDomain, GLogLevelFlags logLevel, string format, void* args)
{
g_logv(Str.toStringz(logDomain), logLevel, Str.toStringz(format), args);
}
}
|