<commit_before>/*
 * Copyright 1999-2006 University of Chicago
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "globus_i_gridftp_server.h"

/**
 * should select logging based on configuration.  log output funcs should
 * still be usable before this and will output to stderr.
 *
 * if this fails, just print to stderr.
 */


static globus_logging_handle_t          globus_l_gfs_log_handle = NULL;
static globus_list_t *                  globus_l_gfs_log_usage_handle_list = NULL;
static FILE *                           globus_l_gfs_log_file = NULL;
static FILE *                           globus_l_gfs_transfer_log_file = NULL;
static globus_bool_t                    globus_l_gfs_log_events = GLOBUS_FALSE;

#define GLOBUS_L_GFS_USAGE_ID 0
#define GLOBUS_L_GFS_USAGE_VER 0

#define GLOBUS_GFS_DEFAULT_TAGLIST "eEvbBNsStcDATaV"
#define GLOBUS_GFS_MAX_TAGCOUNT 25
typedef enum globus_i_gfs_log_usage_tag_e
{
    GLOBUS_I_GFS_USAGE_START    = 'e',
    GLOBUS_I_GFS_USAGE_END      = 'E',
    GLOBUS_I_GFS_USAGE_VER      = 'v',
    GLOBUS_I_GFS_USAGE_BUFFER   = 'b',
    GLOBUS_I_GFS_USAGE_BLOCK    = 'B',
    GLOBUS_I_GFS_USAGE_NBYTES   = 'N',
    GLOBUS_I_GFS_USAGE_STREAMS  = 's',
    GLOBUS_I_GFS_USAGE_STRIPES  = 'S',
    GLOBUS_I_GFS_USAGE_TYPE     = 't',
    GLOBUS_I_GFS_USAGE_CODE     = 'c',
    GLOBUS_I_GFS_USAGE_FILE     = 'f',
    GLOBUS_I_GFS_USAGE_CLIENTIP = 'i',
    GLOBUS_I_GFS_USAGE_DATAIP   = 'I',
    GLOBUS_I_GFS_USAGE_USER     = 'u',
    GLOBUS_I_GFS_USAGE_USERDN   = 'd',
    GLOBUS_I_GFS_USAGE_CONFID   = 'C',
    GLOBUS_I_GFS_USAGE_DSI      = 'D',
    GLOBUS_I_GFS_USAGE_EM       = 'A',
    GLOBUS_I_GFS_USAGE_SCHEMA   = 'T',
    GLOBUS_I_GFS_USAGE_APP      = 'a',
    GLOBUS_I_GFS_USAGE_APPVER   = 'V',
    GLOBUS_I_GFS_USAGE_SESSID   = 'U',
} globus_i_gfs_log_usage_tag_t;

typedef struct globus_l_gfs_log_usage_ent_s
{
    globus_usage_stats_handle_t         handle;
    char *                              target;
    char *                              taglist;<commit_msg>stupid aix and its *syntax* requirements<commit_after>/*
 * Copyright 1999-2006 University of Chicago
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "globus_i_gridftp_server.h"

/**
 * should select logging based on configuration.  log output funcs should
 * still be usable before this and will output to stderr.
 *
 * if this fails, just print to stderr.
 */


static globus_logging_handle_t          globus_l_gfs_log_handle = NULL;
static globus_list_t *                  globus_l_gfs_log_usage_handle_list = NULL;
static FILE *                           globus_l_gfs_log_file = NULL;
static FILE *                           globus_l_gfs_transfer_log_file = NULL;
static globus_bool_t                    globus_l_gfs_log_events = GLOBUS_FALSE;

#define GLOBUS_L_GFS_USAGE_ID 0
#define GLOBUS_L_GFS_USAGE_VER 0

#define GLOBUS_GFS_DEFAULT_TAGLIST "eEvbBNsStcDATaV"
#define GLOBUS_GFS_MAX_TAGCOUNT 25
typedef enum globus_i_gfs_log_usage_tag_e
{
    GLOBUS_I_GFS_USAGE_START    = 'e',
    GLOBUS_I_GFS_USAGE_END      = 'E',
    GLOBUS_I_GFS_USAGE_VER      = 'v',
    GLOBUS_I_GFS_USAGE_BUFFER   = 'b',
    GLOBUS_I_GFS_USAGE_BLOCK    = 'B',
    GLOBUS_I_GFS_USAGE_NBYTES   = 'N',
    GLOBUS_I_GFS_USAGE_STREAMS  = 's',
    GLOBUS_I_GFS_USAGE_STRIPES  = 'S',
    GLOBUS_I_GFS_USAGE_TYPE     = 't',
    GLOBUS_I_GFS_USAGE_CODE     = 'c',
    GLOBUS_I_GFS_USAGE_FILE     = 'f',
    GLOBUS_I_GFS_USAGE_CLIENTIP = 'i',
    GLOBUS_I_GFS_USAGE_DATAIP   = 'I',
    GLOBUS_I_GFS_USAGE_USER     = 'u',
    GLOBUS_I_GFS_USAGE_USERDN   = 'd',
    GLOBUS_I_GFS_USAGE_CONFID   = 'C',
    GLOBUS_I_GFS_USAGE_DSI      = 'D',
    GLOBUS_I_GFS_USAGE_EM       = 'A',
    GLOBUS_I_GFS_USAGE_SCHEMA   = 'T',
    GLOBUS_I_GFS_USAGE_APP      = 'a',
    GLOBUS_I_GFS_USAGE_APPVER   = 'V',
    GLOBUS_I_GFS_USAGE_SESSID   = 'U'
} globus_i_gfs_log_usage_tag_t;

typedef struct globus_l_gfs_log_usage_ent_s
{
    globus_usage_stats_handle_t         handle;
    char *                              target;
    char *                              taglist;
{'fraction_non_alphanumeric': 0.07044198895027624, 'fraction_numerical': 0.006314127861089187, 'mean_word_length': 2.985062893081761, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2476217', 'n_tokens_mistral': 1975, 'n_tokens_neox': 1890, 'n_words': 408}