From db484742efee3b5ae0dd052d4694375bc2d6bd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Pint=C3=A9r?= Date: Tue, 9 Apr 2024 13:28:56 +0200 Subject: [PATCH] SetLogParams defaults to follow doc: stderr and LOG_INFO (mentioned in #391) --- avs_core/core/parser/script.cpp | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/avs_core/core/parser/script.cpp b/avs_core/core/parser/script.cpp index 1bb1e2d88..ed91494e2 100644 --- a/avs_core/core/parser/script.cpp +++ b/avs_core/core/parser/script.cpp @@ -1806,36 +1806,8 @@ AVSValue SetFilterMTMode (AVSValue args, void*, IScriptEnvironment* env) AVSValue SetLogParams(AVSValue args, void*, IScriptEnvironment* env) { - const char *target = NULL; - int level = -1; - - if (1 <= args.ArraySize()) - { - if (args[0].IsString()) { - target = args[0].AsString(); - } - else { - env->ThrowError("1st argument to SetLogParams() must be a string."); - return AVSValue(); - } - } - - if (2 <= args.ArraySize()) - { - if (args[1].IsInt()) { - level = args[1].AsInt(); - } - else { - env->ThrowError("2nd argument to SetLogParams() must be an integer."); - return AVSValue(); - } - } - - if (3 <= args.ArraySize()) - { - env->ThrowError("Too many arguments to SetLogParams()."); - return AVSValue(); - } + const char* target = args[0].AsString("stderr"); + const int level = args[1].AsInt(LOGLEVEL_INFO); InternalEnvironment *envi = static_cast(env); envi->SetLogParams(target, level);