<commit_before>/* See Project chip LICENSE file for licensing information. */

#include <platform/logging/LogV.h>

#include <core/CHIPConfig.h>
#include <support/logging/Constants.h>

#include <os/log.h>

#include <stdarg.h>
#include <stdio.h>
#include <string.h>

namespace chip {
namespace Logging {
namespace Platform {

void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
    char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
    int32_t prefixLen = snprintf(formattedMsg, sizeof(formattedMsg), "CHIP: [%s] ", module);
    if (prefixLen < 0)
    {
        // This should not happen
        return;
    }

    if (static_cast<size_t>(prefixLen) >= sizeof(formattedMsg))
    {<commit_msg>Add missing #include so Darwin logging compiles (#4852)<commit_after>/* See Project chip LICENSE file for licensing information. */

#include <platform/logging/LogV.h>
#include <support/logging/Constants.h>

#include <core/CHIPConfig.h>
#include <support/logging/Constants.h>

#include <os/log.h>

#include <stdarg.h>
#include <stdio.h>
#include <string.h>

namespace chip {
namespace Logging {
namespace Platform {

void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
    char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
    int32_t prefixLen = snprintf(formattedMsg, sizeof(formattedMsg), "CHIP: [%s] ", module);
    if (prefixLen < 0)
    {
        // This should not happen
        return;
    }

    if (static_cast<size_t>(prefixLen) >= sizeof(formattedMsg))
    {
{'fraction_non_alphanumeric': 0.1247537754432042, 'fraction_numerical': 0.007879185817465528, 'mean_word_length': 4.096989966555184, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '6321817', 'n_tokens_mistral': 522, 'n_tokens_neox': 505, 'n_words': 129}