OpenLayers 'Debug Mode'

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers 'Debug Mode'

Christopher Schmidt-2
A bunch of times, we've run into problems where the answer has been "It
would be really nice to let the user know that they are doing something
which is probably wrong, but we don't have a way to inform them." In the
past, OpenLayers had fancy debugging tools, the need for which has
largely been removed by Firebug. However, we oftentimes run into cases
where a user is doing something that they don't really want to do, but
they don't know it.

For example, #248, "Map allows layers to be added twice", is a case
where a user was adding the same layer to the map twice. The patch I've
added prevents this from happening -- but there is no way to say to the
user 'you probably didn't mean to do that'.

Clearly, we don't want to be littering OpenLayers with 'alert'
statements, but at the same time, it might be nice to have a way to put
OpenLayers into a 'debug' mode, where these things can be reported to
the user, either via 'alert()' calls or via console.log() or something
similar. (I don't want to pull in a full logging framework if we can
avoid it.)

This mode should not be the default, but an option on the map could
allow a user to turn it on. The map object could support a 'log()'
method, which could then report things to the user.

I can't think of the other cases this has come up, but I know they
exist. What do people think about adding this in -- possibly not for
2.4, but maybe for 2.5?  

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers 'Debug Mode'

Cameron Shorter
I think you should include a logging framework into the trunk version of
mapbuilder, and then provide 2 releases:
* Release A will be the same as before, it all logging functions are
stripped out. (Use perl or awk or similar).

* Release B will be a debugging release and have all the debugging left in.

Debugging code should look something like:
  Debug.warn(test,"Error message if true");

The Debug framework should allow comments to be outputted as alerts,
text into a widget, or some other format that we want to use later.


Christopher Schmidt wrote:

> A bunch of times, we've run into problems where the answer has been "It
> would be really nice to let the user know that they are doing something
> which is probably wrong, but we don't have a way to inform them." In the
> past, OpenLayers had fancy debugging tools, the need for which has
> largely been removed by Firebug. However, we oftentimes run into cases
> where a user is doing something that they don't really want to do, but
> they don't know it.
>
> For example, #248, "Map allows layers to be added twice", is a case
> where a user was adding the same layer to the map twice. The patch I've
> added prevents this from happening -- but there is no way to say to the
> user 'you probably didn't mean to do that'.
>
> Clearly, we don't want to be littering OpenLayers with 'alert'
> statements, but at the same time, it might be nice to have a way to put
> OpenLayers into a 'debug' mode, where these things can be reported to
> the user, either via 'alert()' calls or via console.log() or something
> similar. (I don't want to pull in a full logging framework if we can
> avoid it.)
>
> This mode should not be the default, but an option on the map could
> allow a user to turn it on. The map object could support a 'log()'
> method, which could then report things to the user.
>
> I can't think of the other cases this has come up, but I know they
> exist. What do people think about adding this in -- possibly not for
> 2.4, but maybe for 2.5?  
>
> Regards,
>  


--
Cameron Shorter
Systems Architect, http://lisasoft.com.au
Tel: +61 (0)2 8570 5011
Mob: +61 (0)419 142 254

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers 'Debug Mode'

Schuyler Erle-2
In reply to this post by Christopher Schmidt-2
+1 for an OpenLayers.Log or .Debug module.

SDE

On Sun, 2007-02-18 at 11:48 -0500, Christopher Schmidt wrote:

> A bunch of times, we've run into problems where the answer has been "It
> would be really nice to let the user know that they are doing something
> which is probably wrong, but we don't have a way to inform them." In the
> past, OpenLayers had fancy debugging tools, the need for which has
> largely been removed by Firebug. However, we oftentimes run into cases
> where a user is doing something that they don't really want to do, but
> they don't know it.
>
> For example, #248, "Map allows layers to be added twice", is a case
> where a user was adding the same layer to the map twice. The patch I've
> added prevents this from happening -- but there is no way to say to the
> user 'you probably didn't mean to do that'.
>
> Clearly, we don't want to be littering OpenLayers with 'alert'
> statements, but at the same time, it might be nice to have a way to put
> OpenLayers into a 'debug' mode, where these things can be reported to
> the user, either via 'alert()' calls or via console.log() or something
> similar. (I don't want to pull in a full logging framework if we can
> avoid it.)
>
> This mode should not be the default, but an option on the map could
> allow a user to turn it on. The map object could support a 'log()'
> method, which could then report things to the user.
>
> I can't think of the other cases this has come up, but I know they
> exist. What do people think about adding this in -- possibly not for
> 2.4, but maybe for 2.5?  
>
> Regards,

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers 'Debug Mode'

Paul Spencer-2
I agree, this is an excellent idea.  One problem with js, though, is  
that it isn't possible to get rid of the debug code at compile time  
so it will always be there slowing things down just by calling an  
empty log/debug function.  Depending on where this code is left, it  
may not be noticeable, but I can see where it would be desirable to  
have log calls in functions that could be called a lot and this could  
have an impact.

To mitigate this, it may be nice to have two builds - production and  
debug.  If debug logging is appropriately marked up, it should be  
easy to remove or comment it as part of building a production  
version ... it could be as easy as grepping for OpenLayers.Debug and  
removing the line.

Normal (not 'built') use and debug builds would not remove the debug  
calls and then debugging could be turned on or off globally.

I'm going off the deep end here, but it might be very nice to have a  
namespace with debug logging to allow turning on logging only in one  
section of the API (for instance OpenLayers.DEBUG = false;  
OpenLayers.Layer.DEBUG = true; OpenLayers.log(OpenLayers.Layer, 'some  
message');) ... And you could keep going with this and add severity  
levels etc.  The scope creep strikes again :)

Cheers

Paul



On 19-Feb-07, at 5:37 PM, Schuyler Erle wrote:

> +1 for an OpenLayers.Log or .Debug module.
>
> SDE
>
> On Sun, 2007-02-18 at 11:48 -0500, Christopher Schmidt wrote:
>> A bunch of times, we've run into problems where the answer has  
>> been "It
>> would be really nice to let the user know that they are doing  
>> something
>> which is probably wrong, but we don't have a way to inform them."  
>> In the
>> past, OpenLayers had fancy debugging tools, the need for which has
>> largely been removed by Firebug. However, we oftentimes run into  
>> cases
>> where a user is doing something that they don't really want to do,  
>> but
>> they don't know it.
>>
>> For example, #248, "Map allows layers to be added twice", is a case
>> where a user was adding the same layer to the map twice. The patch  
>> I've
>> added prevents this from happening -- but there is no way to say  
>> to the
>> user 'you probably didn't mean to do that'.
>>
>> Clearly, we don't want to be littering OpenLayers with 'alert'
>> statements, but at the same time, it might be nice to have a way  
>> to put
>> OpenLayers into a 'debug' mode, where these things can be reported to
>> the user, either via 'alert()' calls or via console.log() or  
>> something
>> similar. (I don't want to pull in a full logging framework if we can
>> avoid it.)
>>
>> This mode should not be the default, but an option on the map could
>> allow a user to turn it on. The map object could support a 'log()'
>> method, which could then report things to the user.
>>
>> I can't think of the other cases this has come up, but I know they
>> exist. What do people think about adding this in -- possibly not for
>> 2.4, but maybe for 2.5?
>>
>> Regards,
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev

+-----------------------------------------------------------------+
|Paul Spencer                          [hidden email]    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+




_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers 'Debug Mode'

Zdenek Vrablik-2
In reply to this post by Christopher Schmidt-2
Hi,

http://log4js.sourceforge.net/ could be the right choice.

The mini log4js version has 4K.

Other logging framework is part of mochikit. I have seen branch in OL svn
server with name Mochikit.
http://www.mochikit.com/examples/logging_pane/index.html



Regards,
Zdenek
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Buttonbar

Olivier Terral
In reply to this post by Christopher Schmidt-2
Hi,


I've commited in my sandbox  a  new Buttonbar who can replaced
EditingToolBar and MouseToolBar.

you can test in examples folder with the file Buttonbar.html.

If you have remarks or suggestions, doesn't hesitate .


Bye
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Buttonbar

John Cole X
Olivier,
  Is your sandbox in the main branch?  Otherwise, what is the url to it?

Thanks,

John

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of olivier.terral
Sent: Tuesday, February 20, 2007 8:54 AM
To: [hidden email]
Subject: [OpenLayers-Dev] Buttonbar

Hi,


I've commited in my sandbox  a  new Buttonbar who can replaced
EditingToolBar and MouseToolBar.

you can test in examples folder with the file Buttonbar.html.

If you have remarks or suggestions, doesn't hesitate .


Bye
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/693 - Release Date: 2/19/2007
5:01 PM
 

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/693 - Release Date: 2/19/2007
5:01 PM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Buttonbar

Christopher Schmidt-2
On Tue, Feb 20, 2007 at 02:20:57PM -0600, John Cole wrote:
> Olivier,
>   Is your sandbox in the main branch?  Otherwise, what is the url to it?

http://svn.openlayers.org/sandbox/oterral/ButtonBar/vector/

--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev