~ubuntu-branches/debian/sid/upstart/sid

« back to all changes in this revision

Viewing changes to nih/logging.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-07-23 00:24:02 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090723002402-pm5tq3kkipr18q00
Tags: 0.6.2-1
* New major upstream release. Closes: #530348
* Remove patches that have been merged upstream or are obsolete
  - debian/patches/01-limits.patch
  - debian/patches/02-telinit-u.patch
  - debian/patches/03-static-convenience-libs.patch
* Add Build-Depends on pkg-config (>= 0.22), libdbus-1-dev (>= 1.2.16) and
  libexpat1-dev (>= 2.0.0). D-Bus has replaced the home-grown IPC.
* Bump Standards-Version to 3.8.2. No further changes.
* debian/copyright
  - Update copyright years.
  - Clarify license text, Upstart is GPL-2 only.
  - Refer to the versioned GPL-2 document.
* Drop upstart-logd package. The logd daemon has been buggy for quite a
  while and thus removed completely upstream.
* debian/upstart.postinst
  - Use "telinit u" to tell init to re-exec itself.
* debian/rules
  - Remove obsolete configure flag.
  - Use dh_install instead of copying the job files around manually.
* Merge the upstart-compat-sysv, startup-tasks and system-services package
  into a single upstart package to avoid any unnecessary diversion between
  the Debian and Ubuntu packaging.
* The location of the job files has changed from /etc/event.d to /etc/init,
  in addition a *.conf suffix is now mandatory.
* Install rc.conf, rc-sysinit.conf, rcS.conf and control-alt-delete.conf as
  provided by upstream.
* debian/conf/*.conf
  - Update tty job files for the new job syntax. Add a description and
    author field.
  - Add dbus-reconnect.conf which tells Upstart to reconnect to the D-Bus
    system bus when runlevel 2345 has been reached.
* Update debian/upstart.install to reflect the changes above.
* Drop debian/upstart.dirs, obsolete.
* debian/README.Debian
  - Sync relevant changes from the latest Ubuntu package.
  - Remove outdated information.
* Add initial support for upstart-job.
  upstart-job is both a virtual package and also small helper utility which
  allows to execute native upstart jobs while preserving the legacy sysv
  "/etc/init.d/<service> <action>" interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* libnih
2
2
 *
3
 
 * Copyright © 2007 Scott James Remnant <scott@netsplit.com>.
 
3
 * Copyright © 2009 Scott James Remnant <scott@netsplit.com>.
 
4
 * Copyright © 2009 Canonical Ltd.
4
5
 *
5
6
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
 
7
 * it under the terms of the GNU General Public License version 2, as
 
8
 * published by the Free Software Foundation.
9
9
 *
10
10
 * This program is distributed in the hope that it will be useful,
11
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
 * GNU General Public License for more details.
14
14
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
15
 * You should have received a copy of the GNU General Public License along
 
16
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
17
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
18
 */
19
19
 
20
20
#ifndef NIH_LOGGING_H
21
21
#define NIH_LOGGING_H
22
22
 
 
23
/**
 
24
 * These functions provide a logging interface for outputting messages
 
25
 * at different priorities, and filtering based on them.
 
26
 *
 
27
 * The output for the logger can be selected using nih_log_set_logger(),
 
28
 * where nih_logger_printf() is the default and nih_logger_syslog() another
 
29
 * popular alternative.
 
30
 *
 
31
 * Log messages are output with different macros.
 
32
 **/
 
33
 
23
34
#include <stdlib.h>
24
35
 
25
36
#include <nih/macros.h>
52
63
 * should not discard any messages and instead nih_log_set_priority() used
53
64
 * to decide the treshold of logged messages.
54
65
 *
55
 
 * The logger may return non-zero to indicate that it was not able to
56
 
 * output the message.
 
66
 * Returns: zero on success, negative value if the logger was not able
 
67
 * to output the message.
57
68
 **/
58
69
typedef int (*NihLogger) (NihLogLevel priority, const char *message);
59
70
 
154
165
 
155
166
NIH_BEGIN_EXTERN
156
167
 
157
 
NihLogLevel nih_log_priority;
158
 
 
 
168
extern NihLogLevel nih_log_priority;
 
169
 
 
170
 
 
171
void nih_log_init         (void);
159
172
 
160
173
void nih_log_set_logger   (NihLogger new_logger);
161
174
void nih_log_set_priority (NihLogLevel new_priority);