Sha256: de0663c02873e64c1424d092026bb7896e81d049dfcccdd0f1c43ba35ef79ceb

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2020 Couchbase, Inc.
 *
 *   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.
 */

#pragma once

#include "test_helper.hxx"

#include <build_config.hxx>

#include <asio/version.hpp>

#include <spdlog/spdlog.h>
#include <spdlog/cfg/env.h>

#include <http_parser.h>

#include <snappy.h>

#include <version.hxx>

#include <cluster.hxx>
#include <operations.hxx>

#include <io/dns_client.hxx>
#include <utils/connection_string.hxx>

void
native_init_logger()
{
    static bool initialized = false;

    if (!initialized) {
        spdlog::set_pattern("[%Y-%m-%d %T.%e] [%P,%t] [%^%l%$] %oms, %v");

        auto env_val = spdlog::details::os::getenv("COUCHBASE_BACKEND_LOG_LEVEL");
        if (env_val.empty()) {
            spdlog::set_level(spdlog::level::warn);
        } else {
            auto levels = spdlog::cfg::helpers::extract_levels(env_val);
            spdlog::details::registry::instance().update_levels(std::move(levels));
        }

        initialized = true;
    }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
couchbase-3.0.1-universal-darwin-19 ext/test/test_helper_native.hxx
couchbase-3.0.1 ext/test/test_helper_native.hxx