ODS Change Suggestion

Plaats een reactie

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode staat AAN
[img] staat AAN
[url] staat AAN
Smilies staan AAN

Voorafgaande berichten
   

Weergave uitklappen Voorafgaande berichten: ODS Change Suggestion

Re: ODS Change Suggestion

door MyVikes » za jul 23, 2022 2:26 am

Sounds good...thx

Re: ODS Change Suggestion

door drakinite » vr jul 22, 2022 3:08 pm

Try this:

Code: Selecteer alles

function debugLog(...params) {
    ODS(params.join(', '));
}
Better not override the default console.log, in case it causes errors or unexpected behavior for other addons. Replace your console.log() calls with debugLog(), and it'll join all the parameters together into one string then call ODS.

ODS Change Suggestion

door MyVikes » vr jul 22, 2022 10:41 am

I've recently been experimenting with using the MM5 ODS function ( https://www.mediamonkey.com/wiki/Import ... ons%29#ODS ) and the MS DebugView for my console messages. The format for the javascript console messages i've been using is along the lines of using the comma as follows:

Code: Selecteer alles

console.log("Variable varName value is:", varName)
where the output would then be, for example, "Variable varName value is: 55".

So at the start of my script i simply added this:

Code: Selecteer alles

console.log = ODS; 
It kinda worked as i see my mesages in MS DebugView except that the commas are ignored and i only see "Variable varName value is:". if i change the , to a + then of course it works.

It seems like it might be a simple ask to have the ODS function append all the values separated by commas in the parenthesis to be more like console.log and so as others like myself would not to have to rewrite all my console.log messages.

:D

Omhoog