Rename log to logging

This commit is contained in:
2025-02-12 23:34:47 +01:00
parent e297b4182b
commit cb77cbe9ce
5 changed files with 8 additions and 9 deletions

View File

@ -0,0 +1,23 @@
#include "asl/logging/logging.hpp"
#include "asl/testing/testing.hpp"
#include "asl/string_builder.hpp"
ASL_TEST(log)
{
asl::log::log(asl::log::kInfo, asl::source_location{}, "Hello, {}!", "world"_sv);
ASL_LOG_ERROR("Oh no! {}", 42);
}
static asl::StringWriter g_string_writer{};
ASL_TEST(custom_writer)
{
asl::log::register_logger<asl::log::DefaultLogger<asl::StringWriter<>&>>(g_string_writer);
ASL_LOG_INFO("Hello");
auto sv = g_string_writer.as_string_view();
ASL_TEST_EXPECT(sv == "[ INFO ] asl/logging/logging_tests.cpp:18: Hello\n");
}