mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
1. Support Java/log4j log level text. 2. Support configuring by `--log-new-level=on` which is enabled by default. 3. Support `--log-new-level=off` to use SRS 4.0 log level for compatibility.
This commit is contained in:
parent
20c38e07c0
commit
2d1ba46e37
14 changed files with 147 additions and 24 deletions
|
@ -16,6 +16,7 @@ using namespace std;
|
|||
#include <srs_protocol_st.hpp>
|
||||
#include <srs_protocol_rtmp_stack.hpp>
|
||||
#include <srs_utest_kernel.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
|
||||
MockSrsConfigBuffer::MockSrsConfigBuffer(string buf)
|
||||
{
|
||||
|
@ -3832,3 +3833,26 @@ VOID TEST(ConfigMainTest, CheckIncludeConfig)
|
|||
HELPER_ASSERT_FAILED(conf.parse("include ./conf/include_test/include.conf;"));
|
||||
}
|
||||
}
|
||||
|
||||
VOID TEST(ConfigMainTest, LogLevelV2)
|
||||
{
|
||||
srs_error_t err;
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
HELPER_ASSERT_SUCCESS(conf.parse(_MIN_OK_CONF));
|
||||
EXPECT_EQ(SrsLogLevelTrace, srs_get_log_level(conf.get_log_level()));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
HELPER_ASSERT_SUCCESS(conf.parse(_MIN_OK_CONF "srs_log_level warn;"));
|
||||
EXPECT_EQ(SrsLogLevelWarn, srs_get_log_level(conf.get_log_level()));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
HELPER_ASSERT_SUCCESS(conf.parse(_MIN_OK_CONF "srs_log_level_v2 warn;"));
|
||||
EXPECT_EQ(SrsLogLevelWarn, srs_get_log_level(conf.get_log_level_v2()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue