<commit_before>// Module:  Log4CPLUS
// File:    layout.cxx
// Created: 6/2001
// Author:  <NAME>
//
//
// Copyright (C) The Apache Software Foundation. All rights reserved.
//
// This software is published under the terms of the Apache Software
// License version 1.1, a copy of which has been included with this
// distribution in the LICENSE.APL file.
//

#include <log4cplus/layout.h>
#include <log4cplus/spi/loggingevent.h>


using namespace log4cplus;
using namespace log4cplus::helpers;
using namespace log4cplus::spi;

#define BUFFER_SIZE 20


std::string 
log4cplus::getFormattedTime(time_t time, const std::string& fmt)
{
    char buffer[BUFFER_SIZE];
    int len = strftime(buffer, BUFFER_SIZE, fmt.c_str(), gmtime(&time));
    buffer[len] = '\0';
    return buffer;
}



void
SimpleLayout::formatAndAppend(std::ostream& output, const log4cplus::spi::InternalLoggingEvent& event)
{
    output << event.priority << " - " << event.message << std::endl;
}



TTCCLayout::TTCCLayout()
: dateFormat("%m-%d-%y %H:%M:%S")
{
}


TTCCLayout::~TTCCLayout()
{
}


void
TTCCLayout::formatAndAppend(std::ostream& output, const log4cplus::spi::InternalLoggingEvent& event)
{
    output << getFormattedTime(event.timestamp, dateFormat) << " ["
           << event.thread << "] "
           << event.priority << " "
           << event.categoryName << " <"
           << event.ndc << "> - "
           << event.message;
    if(event.file != NULL) {
        output << " [" << event.file << ':' << event.line << ']';
    }
    output << std::endl;
}



<commit_msg>Added the TTCCLayout(log4cplus::helpers::Properties properties) ctor.<commit_after>// Module:  Log4CPLUS
// File:    layout.cxx
// Created: 6/2001
// Author:  <NAME>
//
//
// Copyright (C) The Apache Software Foundation. All rights reserved.
//
// This software is published under the terms of the Apache Software
// License version 1.1, a copy of which has been included with this
// distribution in the LICENSE.APL file.
//

#include <log4cplus/layout.h>
#include <log4cplus/spi/loggingevent.h>


using namespace log4cplus;
using namespace log4cplus::helpers;
using namespace log4cplus::spi;

#define BUFFER_SIZE 20


std::string 
log4cplus::getFormattedTime(time_t time, const std::string& fmt)
{
    char buffer[BUFFER_SIZE];
    int len = strftime(buffer, BUFFER_SIZE, fmt.c_str(), gmtime(&time));
    buffer[len] = '\0';
    return buffer;
}



void
SimpleLayout::formatAndAppend(std::ostream& output, const log4cplus::spi::InternalLoggingEvent& event)
{
    output << event.priority << " - " << event.message << std::endl;
}



TTCCLayout::TTCCLayout()
: dateFormat("%m-%d-%y %H:%M:%S")
{
}


TTCCLayout::TTCCLayout(log4cplus::helpers::Properties properties)
: Layout(properties),
  dateFormat("%m-%d-%y %H:%M:%S")
{
}


TTCCLayout::~TTCCLayout()
{
}


void
TTCCLayout::formatAndAppend(std::ostream& output, const log4cplus::spi::InternalLoggingEvent& event)
{
    output << getFormattedTime(event.timestamp, dateFormat) << " ["
           << event.thread << "] "
           << event.priority << " "
           << event.categoryName << " <"
           << event.ndc << "> - "
           << event.message;
    if(event.file != NULL) {
        output << " [" << event.file << ':' << event.line << ']';
    }
    output << std::endl;
}




{'fraction_non_alphanumeric': 0.16393939393939394, 'fraction_numerical': 0.012121212121212121, 'mean_word_length': 3.485054347826087, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 11, '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': '5076151', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1083, 'n_words': 239}