<commit_before>#include <coffee/core/base/debug/debugprinter.h>
#include <coffee/core/plat/plat_environment.h>

namespace Coffee{
namespace DebugFun{

cstring severity_string(Severity sev)
{
    cstring const severity_info = "INFO";
    cstring const severity_debg = "DEBG";
    cstring const severity_warn = "WARN";
    cstring const severity_ftal = "FTAL";
    cstring const severity_verb = "VERB";

    cstring severity_str = nullptr;

    switch(sev)
    {
    case Severity::Information:
        severity_str = severity_info;
        break;
    case Severity::Verbose:
        severity_str = severity_verb;
        break;
    case Severity::Debug:
    case Severity::Low:
        severity_str = severity_debg;
        break;
    case Severity::Medium:
        severity_str = severity_warn;
        break;
    case Severity::Critical:
    case Severity::Fatal:
    case Severity::High:
        severity_str = severity_ftal;
        break;
    }

    return severity_str;
}

void DebugPrinterImpl::AddContextString(CString& prefix, Severity sev)
{
    cstring severity_str = severity_string(sev);

    CString cclock = Time::ClockString();
#if !defined(COFFEE_PLATFORM_OUTPUT_FORMAT)
    CString ms_time = Convert::uintltostring(Time::Microsecond()/1000);
    CString clock = cStringFormat("{0}.{1}",
                                  cclock,
                                  StrUtil::lpad(ms_time, '0', 3)
                                  );
    prefix = cStringFormat("{0}:", clock.c_str());
    prefix.push_back(severity_str[0]);

    ColorMap::ColorText(prefix, ColorMap::CombineFormat(CmdColor::Green, CmdColor::Blue));
#endif
}

void OutputPrinterImpl::fprintf_platform(FILE *stream, CString formatted,
                                         Severity sev, bool locking)
{
    C_USED(sev);

    if(locking)
        PrinterLock.lock();
#if defined(COFFEE_ANDROID)
    int flag = 0;

    switch(sev)
    {
    case Severity::Information:
        flag = ANDROID_LOG_INFO;<commit_msg> - Fix millisecond printing, no longer printing the Unix timestamp on every print<commit_after>#include <coffee/core/base/debug/debugprinter.h>
#include <coffee/core/plat/plat_environment.h>

namespace Coffee{
namespace DebugFun{

cstring severity_string(Severity sev)
{
    cstring const severity_info = "INFO";
    cstring const severity_debg = "DEBG";
    cstring const severity_warn = "WARN";
    cstring const severity_ftal = "FTAL";
    cstring const severity_verb = "VERB";

    cstring severity_str = nullptr;

    switch(sev)
    {
    case Severity::Information:
        severity_str = severity_info;
        break;
    case Severity::Verbose:
        severity_str = severity_verb;
        break;
    case Severity::Debug:
    case Severity::Low:
        severity_str = severity_debg;
        break;
    case Severity::Medium:
        severity_str = severity_warn;
        break;
    case Severity::Critical:
    case Severity::Fatal:
    case Severity::High:
        severity_str = severity_ftal;
        break;
    }

    return severity_str;
}

void DebugPrinterImpl::AddContextString(CString& prefix, Severity sev)
{
    cstring severity_str = severity_string(sev);

    CString cclock = Time::ClockString();
#if !defined(COFFEE_PLATFORM_OUTPUT_FORMAT)
    CString ms_time = cast_pod(Time::Microsecond() % 1000);
    CString clock = cStringFormat("{0}.{1}",
                                  cclock,
                                  StrUtil::lpad(ms_time, '0', 3)
                                  );
    prefix = cStringFormat("{0}:", clock.c_str());
    prefix.push_back(severity_str[0]);

    ColorMap::ColorText(prefix, ColorMap::CombineFormat(CmdColor::Green, CmdColor::Blue));
#endif
}

void OutputPrinterImpl::fprintf_platform(FILE *stream, CString formatted,
                                         Severity sev, bool locking)
{
    C_USED(sev);

    if(locking)
        PrinterLock.lock();
#if defined(COFFEE_ANDROID)
    int flag = 0;

    switch(sev)
    {
    case Severity::Information:
        flag = ANDROID_LOG_INFO;
{'fraction_non_alphanumeric': 0.10396039603960396, 'fraction_numerical': 0.005445544554455445, 'mean_word_length': 2.7209944751381214, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2127023', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1238, 'n_words': 254}