<commit_before>/******************************************************************************
*******************************************************************************
**
**  Copyright (C) 2005-2007 Red Hat, Inc.  All rights reserved.
**
**  This copyrighted material is made available to anyone wishing to use,
**  modify, copy, or redistribute it subject to the terms and conditions
**  of the GNU General Public License v.2.
**
*******************************************************************************
******************************************************************************/

#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>

#include <openais/service/logsys.h>
#include "logging.h"

/* Make this global so that all of cman can use the same subsys name */
unsigned int logsys_subsys_id;
int subsys_mask = 0;

void init_debug(int subsystems)
{
	logsys_subsys_id = _logsys_subsys_create("CMAN", (subsystems?LOG_LEVEL_DEBUG:LOG_LEVEL_WARNING) );
	logsys_config_mode_set(LOG_MODE_BUFFER_BEFORE_CONFIG | ((subsystems)?LOG_MODE_OUTPUT_STDERR:0));
	subsys_mask = subsystems;
}

void set_debuglog(int subsystems)
{
	subsys_mask = subsystems;
}


void cman_flush_debuglog()
{
	logsys_config_mode_set(LOG_MODE_FLUSH_AFTER_CONFIG | ((subsys_mask)?LOG_MODE_OUTPUT_STDERR:0));
}
<commit_msg>Don't use _logsys functions as I get my wrist slapped.<commit_after>/******************************************************************************
*******************************************************************************
**
**  Copyright (C) 2005-2007 Red Hat, Inc.  All rights reserved.
**
**  This copyrighted material is made available to anyone wishing to use,
**  modify, copy, or redistribute it subject to the terms and conditions
**  of the GNU General Public License v.2.
**
*******************************************************************************
******************************************************************************/

#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>

#include <openais/service/logsys.h>
#include "logging.h"

/* Make this global so that all of cman can use the same subsys name */
unsigned int logsys_subsys_id;
int subsys_mask = 0;

void init_debug(int subsystems)
{
	logsys_subsys_id = logsys_config_subsys_set ("CMAN", LOGSYS_TAG_LOG, (subsystems?LOG_LEVEL_DEBUG:LOG_LEVEL_WARNING) );
	logsys_config_mode_set(LOG_MODE_BUFFER_BEFORE_CONFIG | ((subsystems)?LOG_MODE_OUTPUT_STDERR:0));
	subsys_mask = subsystems;
}

void set_debuglog(int subsystems)
{
	subsys_mask = subsystems;
}


void cman_flush_debuglog()
{
	logsys_config_mode_set(LOG_MODE_FLUSH_AFTER_CONFIG | ((subsys_mask)?LOG_MODE_OUTPUT_STDERR:0));
}

{'fraction_non_alphanumeric': 0.30379321920107416, 'fraction_numerical': 0.008056394763343404, 'mean_word_length': 7.441926345609065, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3702825', 'n_tokens_mistral': 945, 'n_tokens_neox': 876, 'n_words': 215}