Hi Devs,

Thanks for the inputs.

We already have added "Log" object which have Java like logging options.
Considering the ideas, we will revert back to this "Log" object instead of
introducing a "console" object.

Thanks,
Maduranga

On Thu, Jan 18, 2018 at 9:55 AM, SajithAR Ariyarathna <[email protected]>
wrote:

>
>
> On Wed, Jan 17, 2018 at 10:38 PM, Thusitha Kalugamage <[email protected]>
> wrote:
>
>> Hi Maduranga,
>>
>> I'm not sure whether we can have a 1 to 1 mapping between Apache commons
>> logging and all the methods available for console object or not. But
>> wouldn't it be confusing for the user to support a limited set of methods?
>> IMHO, We should at least state somewhere in the ui about the supported
>> and non-supported methods in conditional authentication context.
>>
>> For instance, some dev might find console.info() [1] as their most used
>> logging method and will lead to bad scripting experience. What are your
>> thoughts on this?
>>
>> [1] https://developer.mozilla.org/en-US/docs/Web/API/Console/info
>>
>>
>> Regards,
>>
>> On Wed, Jan 17, 2018 at 11:34 AM, Maduranga Siriwardena <
>> [email protected]> wrote:
>>
>>> Hi Devs,
>>>
>>> To support logging in the JavaScript used for conditional
>>> authentication (mail thread [1] @ architecture@) we are trying to mimic
>>> the "console.log()" in the JavaScripts.
>>>
>>> To achieve this, we have added a binding for a apache commons log object
>>> with key name "console" to nashorn engine. So this support logging with
>>> below syntax withing the JavaScript.
>>>
>>> console.log("some test")
>>> console.debug("some test")
>>> console.error("some test")
>>>
>> -1, Let me explain why.
>
> 1.  Availability of console.log() leads to developers to assume that
> other functions on the console object [1] are also available (e.g.
> colsole.time() ), which is not the case as we are only implementing above
> 3 functions.
> 2. Availability of the console object suggests that other Web APIs [2]
> are also available (e.g. Document), which is a false assumption.
>
> Instead, we can introduce Log or Logger object which will have info, debug,
> error (even trace) functions.
>
> [1] https://developer.mozilla.org/en-US/docs/Web/API/Console
> [2] https://developer.mozilla.org/en-US/docs/Web/API
>
> Thanks.
>
>>
>>> Above logs will be working as usual when used in Java classes (printed
>>> in wso2carbon.log file and backend console).
>>>
>>> Any suggestions?
>>>
>>> [1] [Architecture] Conditional Authentication Support on WSO2 Identity
>>> Server
>>>
>>> Thanks,
>>> --
>>> Maduranga Siriwardena
>>> Senior Software Engineer
>>> WSO2 Inc; http://wso2.com/
>>>
>>> Email: [email protected]
>>> Mobile: +94718990591 <+94%2071%20899%200591>
>>> Blog: *https://madurangasiriwardena.wordpress.com/
>>> <https://madurangasiriwardena.wordpress.com/>*
>>> <http://wso2.com/signature>
>>>
>>
>>
>>
>> --
>> Thusitha Kalugamage
>> *Software Engineer*
>> Mobile : +94 (0) 774 074370
>> Tel       : +94 (0) 112 145 345
>> [email protected]
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sajith Janaprasad Ariyarathna
> Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
> <https://wso2.com/signature>
>



-- 
Maduranga Siriwardena
Senior Software Engineer
WSO2 Inc; http://wso2.com/

Email: [email protected]
Mobile: +94718990591
Blog: *https://madurangasiriwardena.wordpress.com/
<https://madurangasiriwardena.wordpress.com/>*
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to