• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

questions about console.info()

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using "console.info()" together with firefox firebug to debug js code,

i have following question:

can i leave all these console debugging code in the js file, and if my client is using IE, what will happen? is that going to produce any unhappy outcomes?

in other words, Is "console.info()" for firefox/firebug only, or it is a js built in function?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The console methods are supported by a wide range of browsers, but will cause problems if the browser does not support then or if debugging is turned off. Besides, do your customers really want to see your debugging messages on their consoles?
 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:The console methods are supported by a wide range of browsers, but will cause problems if the browser does not support then or if debugging is turned off. Besides, do your customers really want to see your debugging messages on their consoles?




hi bear,

I dont know whether my client likes it or not.

my question is, how do you handle all these console debugging codes? we need to remove it one by one when the code is committed?

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I remove them before a build.

Another tactic I've seen is to create your own wrapper method that does nothing if the symbol console is undefined, and performs logging if it is.
 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Personally, I remove them before a build.

Another tactic I've seen is to create your own wrapper method that does nothing if the symbol console is undefined, and performs logging if it is.



thanks for your suggestion!
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Better to remove them, nothing like leaving code in your application that does nothing. Milliseconds add up.

Eric
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic