Skip to content

Commit

Permalink
DIOS-5077 Give warning level logs their own config not tied to debug …
Browse files Browse the repository at this point in the history
…level (#11)
  • Loading branch information
bcostdolby authored Apr 9, 2024
1 parent d28aefe commit 9569b9b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/VideoCodecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ VideoCodecs.generateThumbnail = function(encoderCodec, codec, buffer)
};


/**
* Enable or disable log level traces
* @memberof VideoCodecs
* @param {Boolean} flag
*/
VideoCodecs.enableWarning = function(flag)
{
//Set flag
Native.VideoCodecsModule.EnableWarning(flag);
};


/**
* Enable or disable log level traces
* @memberof VideoCodecs
Expand Down
2 changes: 1 addition & 1 deletion media-server
Submodule media-server updated 1 files
+13 −1 include/log.h
7 changes: 7 additions & 0 deletions src/VideoCodecsModule.i
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public:
while(queue.try_dequeue(func)){}
}

static void EnableWarning(bool flag)
{
//Enable log
Logger::EnableWarning(flag);
}

static void EnableLog(bool flag)
{
//Enable log
Expand Down Expand Up @@ -122,6 +128,7 @@ struct VideoCodecsModule
{
static void Initialize();
static void Terminate();
static void EnableWarning(bool flag);
static void EnableLog(bool flag);
static void EnableDebug(bool flag);
static void EnableUltraDebug(bool flag);
Expand Down
34 changes: 34 additions & 0 deletions src/video-codecs_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,12 @@ class VideoCodecsModule
while(queue.try_dequeue(func)){}
}

static void EnableWarning(bool flag)
{
//Enable log
Logger::EnableWarning(flag);
}

static void EnableLog(bool flag)
{
//Enable log
Expand Down Expand Up @@ -4754,6 +4760,33 @@ static SwigV8ReturnValue _wrap_VideoCodecsModule_Terminate(const SwigV8Arguments
}


static SwigV8ReturnValue _wrap_VideoCodecsModule_EnableWarning(const SwigV8Arguments &args) {
SWIGV8_HANDLESCOPE();

SWIGV8_VALUE jsresult;
bool arg1 ;
bool val1 ;
int ecode1 = 0 ;

if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_VideoCodecsModule_EnableWarning.");

ecode1 = SWIG_AsVal_bool(args[0], &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "VideoCodecsModule_EnableWarning" "', argument " "1"" of type '" "bool""'");
}
arg1 = static_cast< bool >(val1);
VideoCodecsModule::EnableWarning(arg1);
jsresult = SWIGV8_UNDEFINED();


SWIGV8_RETURN(jsresult);

goto fail;
fail:
SWIGV8_RETURN(SWIGV8_UNDEFINED());
}


static SwigV8ReturnValue _wrap_VideoCodecsModule_EnableLog(const SwigV8Arguments &args) {
SWIGV8_HANDLESCOPE();

Expand Down Expand Up @@ -6564,6 +6597,7 @@ v8::Local<v8::Object> _exports_ThumbnailGeneratorTask_obj = _exports_ThumbnailGe
/* add static class functions and variables */
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "Initialize", _wrap_VideoCodecsModule_Initialize, context);
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "Terminate", _wrap_VideoCodecsModule_Terminate, context);
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "EnableWarning", _wrap_VideoCodecsModule_EnableWarning, context);
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "EnableLog", _wrap_VideoCodecsModule_EnableLog, context);
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "EnableDebug", _wrap_VideoCodecsModule_EnableDebug, context);
SWIGV8_AddStaticFunction(_exports_VideoCodecsModule_obj, "EnableUltraDebug", _wrap_VideoCodecsModule_EnableUltraDebug, context);
Expand Down

0 comments on commit 9569b9b

Please sign in to comment.