Blame nslcd/log.h

Packit 6bd9ab
/*
Packit 6bd9ab
   log.h - definitions of logging funtions
Packit 6bd9ab
Packit 6bd9ab
   Copyright (C) 2002, 2003, 2007, 2008, 2010, 2011, 2012, 2013 Arthur de Jong
Packit 6bd9ab
Packit 6bd9ab
   This library is free software; you can redistribute it and/or
Packit 6bd9ab
   modify it under the terms of the GNU Lesser General Public
Packit 6bd9ab
   License as published by the Free Software Foundation; either
Packit 6bd9ab
   version 2.1 of the License, or (at your option) any later version.
Packit 6bd9ab
Packit 6bd9ab
   This library is distributed in the hope that it will be useful,
Packit 6bd9ab
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6bd9ab
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6bd9ab
   Lesser General Public License for more details.
Packit 6bd9ab
Packit 6bd9ab
   You should have received a copy of the GNU Lesser General Public
Packit 6bd9ab
   License along with this library; if not, write to the Free Software
Packit 6bd9ab
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 6bd9ab
   02110-1301 USA
Packit 6bd9ab
*/
Packit 6bd9ab
Packit 6bd9ab
Packit 6bd9ab
#ifndef NSLCD__LOG_H
Packit 6bd9ab
#define NSLCD__LOG_H 1
Packit 6bd9ab
Packit 6bd9ab
#include <syslog.h>
Packit 6bd9ab
#include "compat/attrs.h"
Packit 6bd9ab
Packit 6bd9ab
/* set loglevel when no logging is configured */
Packit 6bd9ab
void log_setdefaultloglevel(int loglevel);
Packit 6bd9ab
Packit 6bd9ab
/* configure logging to a file */
Packit 6bd9ab
void log_addlogging_file(int loglevel, const char *filename);
Packit 6bd9ab
Packit 6bd9ab
/* configure logging to syslog */
Packit 6bd9ab
void log_addlogging_syslog(int loglevel);
Packit 6bd9ab
Packit 6bd9ab
/* configure a null logging mode (no logging) */
Packit 6bd9ab
void log_addlogging_none(void);
Packit 6bd9ab
Packit 6bd9ab
/* start the logging with the configured logging methods
Packit 6bd9ab
   if no method is configured yet, logging is done to syslog */
Packit 6bd9ab
void log_startlogging(void);
Packit 6bd9ab
Packit 6bd9ab
/* indicate that a session id should be included in the output
Packit 6bd9ab
   and set it to a new value */
Packit 6bd9ab
void log_newsession(void);
Packit 6bd9ab
Packit 6bd9ab
/* indicate that we should clear any session identifiers set by
Packit 6bd9ab
   log_newsession */
Packit 6bd9ab
void log_clearsession(void);
Packit 6bd9ab
Packit 6bd9ab
/* indicate that a request identifier should be included in the output
Packit 6bd9ab
   from this point on, until log_newsession() is called */
Packit 6bd9ab
void log_setrequest(const char *format, ...)
Packit 6bd9ab
  LIKE_PRINTF(1, 2);
Packit 6bd9ab
Packit 6bd9ab
/* log the given message using the configured logging method */
Packit 6bd9ab
void log_log(int pri, const char *format, ...)
Packit 6bd9ab
  LIKE_PRINTF(2, 3);
Packit 6bd9ab
Packit 6bd9ab
/* log the logging configuration on DEBUG loglevel */
Packit 6bd9ab
void log_log_config(void);
Packit 6bd9ab
Packit 6bd9ab
#endif /* not NSLCD__LOG_H */