nscd_log.h revision cb5caa98562cf06753163f558cbcfe30b8f4673a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _NSCD_LOG_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSCD_LOG_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "nscd_common.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * nscd logging options
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * components: select more than one by OR'ing
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_NONE 0x0000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_ACCESS_INFO 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_INT_ADDR 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_NSW_STATE 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_GETENT_CTX 0x0008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_SWITCH_ENGINE 0x0010
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_CONFIG 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_FRONT_END 0x0040
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_CACHE 0x0080
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_SMF_MONITOR 0x0100
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_ADMIN 0x0200
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_SELF_CRED 0x0400
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_ALL 0x07ff
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * debug level: select more than one by OR'ing
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_NONE 0x0000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_CANT_FOUND 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_ALERT 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_CRIT 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_ERROR 0x0008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_WARNING 0x0010
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_NOTICE 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_INFO 0x0040
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_DEBUG 0x0080
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCD_LOG_LEVEL_ALL 0x00ff
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * _nscd_log_comp and _nscd_log_level defined in nscd_log.c
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int _nscd_log_comp;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int _nscd_log_level;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSCD_LOG(comp, lvl) if ((_nscd_log_comp & (comp)) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (_nscd_log_level & (lvl))) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _nscd_logit
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSCD_LOG_IF(comp, lvl) if ((_nscd_log_comp & (comp)) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (_nscd_log_level & (lvl)))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * prototypes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid _nscd_logit(char *funcname, char *format, ...);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortenscd_rc_t _nscd_set_debug_level(int level);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortenscd_rc_t _nscd_set_log_file(char *name);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _NSCD_LOG_H */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte