SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
J avaScript Best Practise
Debugging und Logging

Martin Ruprecht I 03. Februar 2011




                                     ©Mayflower GmbH 2011
Mayflower GmbH I 2
Mayflower GmbH I 3
1997

alert( )




           Mayflower GmbH I 4
1997           2011

alert( )   console.log( )




                            Mayflower GmbH I 5
1997           2010         201*

alert( )   console.log( )




                               Mayflower GmbH I 6
1997           2010                                201*

alert( )   console.log( )

             „HTML5 is about moving
               from documents to
              applications and from
               hacks to solutions.“
                   – Chris Heilmann, Mozilla Foundation

                                                          Mayflower GmbH I 7
Tools
        Mayflower GmbH I 8
Tools



I Firebug, Firebug Lite
I Entwickler Tools (IE und Chrome)
I Webinspector Safari
I Web Developer Toolbar
I YSLOW (Performance Debugging)
I CompanionJS
I Fiddler
I ...


                                     Mayflower GmbH I 9
Firebug? Webinspector? Entwickler Tools?



I Shortcuts
   ·Ctrl + A, Ctrl + C, Ctrl + V, Pfeil nach oben
I Autocomplete mit TAB
I *.toString( )
I *.toJson( )




                                                    Mayflower GmbH I 10
Debugging Strategien



I Untersuchen von HTML-Elementen
I Aufzeichnen von Log-Nachrichten
I Breakpoints
I Prototyping




                                    Mayflower GmbH I 11
Untersuchen von HTML-Elementen




                                 Mayflower GmbH I 12
Aufzeichnen von Log-Nachrichten



I console.log/warn/error/info/exception/assert
  · Unterschiedliche Ausgabe nach Level in Konsole
I console.dir(object )
  · Schreibt object formatiert in die Konsole
I console.count( )
  · Zähler, z.B. für Funktionsaufrufe




                                                     Mayflower GmbH I 13
Aufzeichnen von Log-Nachrichten




                                  Mayflower GmbH I 14
Breakpoints



I debugger;
I Individuelle Breakpoints
I Conditional Breakpoints




                             Mayflower GmbH I 15
Fehler gefunden?



I Stack Trace
  · console.trace( )
I Live Fixen / Testen / weiter entwickeln




                                            Mayflower GmbH I 16
Fehler nicht gefunden?



I Google
I Kollegen fragen
I kurze Pause machen
I genaue Problemdefinition




                             Mayflower GmbH I 17
Fazit: Real life logging



I Logging auch an den Server
I unabhängig vom Browser einsetzbar
I auch in Produktion
I unterschiedliche Levels




                                      Mayflower GmbH I 18
DEMO




       Mayflower GmbH I 19
Vielen Dank für Ihre
     Aufmerksamkeit!




      Kontakt   Martin Ruprecht
                martin.ruprecht@mayflower.de
                +49 89 242054 1116
                Mayflower GmbH
                Mannhardtstrasse6
                80538 München


14.03.11                          Mayflower GmbH   20

Mais conteúdo relacionado

Destaque

Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHPNick Belhomme
 
The Solar Framework for PHP
The Solar Framework for PHPThe Solar Framework for PHP
The Solar Framework for PHPConFoo
 
Big server-is-watching-you
Big server-is-watching-youBig server-is-watching-you
Big server-is-watching-youmkherlakian
 
In The Shadow Of The Ninja
In The Shadow Of The NinjaIn The Shadow Of The Ninja
In The Shadow Of The Ninjazburnham
 
Verlernte Agilität - Schleichende Fehler in agilen Prozessen
Verlernte Agilität - Schleichende Fehler in agilen ProzessenVerlernte Agilität - Schleichende Fehler in agilen Prozessen
Verlernte Agilität - Schleichende Fehler in agilen ProzessenSebastian Bauer
 
Von Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenVon Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenTomas Caspers
 
PHPBenelux 2011 - Seeing PHP throug a blue azure sky
PHPBenelux 2011 - Seeing PHP throug a blue azure skyPHPBenelux 2011 - Seeing PHP throug a blue azure sky
PHPBenelux 2011 - Seeing PHP throug a blue azure skyMaarten Balliauw
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionIan Barber
 
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.Stephan Schmidt
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3Nate Abele
 
Real time voice call integration - Confoo 2012
Real time voice call integration - Confoo 2012Real time voice call integration - Confoo 2012
Real time voice call integration - Confoo 2012Michael Peacock
 
Confoo 2011-planifier-accessibilite-dans-votre-organisation
Confoo 2011-planifier-accessibilite-dans-votre-organisationConfoo 2011-planifier-accessibilite-dans-votre-organisation
Confoo 2011-planifier-accessibilite-dans-votre-organisationAccessibilitéWeb
 
Back Alleys of ruby
Back Alleys of rubyBack Alleys of ruby
Back Alleys of rubymalafortune
 
One Click Deployment with Jenkins
One Click Deployment with JenkinsOne Click Deployment with Jenkins
One Click Deployment with JenkinsMayflower GmbH
 
A great attitude -presentation
A great attitude -presentationA great attitude -presentation
A great attitude -presentationPeter Chang
 
The top 10 web application intrusion techniques
The top 10 web application intrusion techniquesThe top 10 web application intrusion techniques
The top 10 web application intrusion techniquesAntonio Fontes
 
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)triagens
 

Destaque (20)

Confoo 2012 kata
Confoo 2012   kataConfoo 2012   kata
Confoo 2012 kata
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHP
 
The Solar Framework for PHP
The Solar Framework for PHPThe Solar Framework for PHP
The Solar Framework for PHP
 
Advanced CouchDB phpday.it
Advanced CouchDB phpday.itAdvanced CouchDB phpday.it
Advanced CouchDB phpday.it
 
Big server-is-watching-you
Big server-is-watching-youBig server-is-watching-you
Big server-is-watching-you
 
In The Shadow Of The Ninja
In The Shadow Of The NinjaIn The Shadow Of The Ninja
In The Shadow Of The Ninja
 
Verlernte Agilität - Schleichende Fehler in agilen Prozessen
Verlernte Agilität - Schleichende Fehler in agilen ProzessenVerlernte Agilität - Schleichende Fehler in agilen Prozessen
Verlernte Agilität - Schleichende Fehler in agilen Prozessen
 
Von Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenVon Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und Wespen
 
PHPBenelux 2011 - Seeing PHP throug a blue azure sky
PHPBenelux 2011 - Seeing PHP throug a blue azure skyPHPBenelux 2011 - Seeing PHP throug a blue azure sky
PHPBenelux 2011 - Seeing PHP throug a blue azure sky
 
ZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 VersionZeroMQ Is The Answer: PHP Tek 11 Version
ZeroMQ Is The Answer: PHP Tek 11 Version
 
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.
23 Dinge, die Sie über Software-Entwicklung in Teams wissen sollten.
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
 
Real time voice call integration - Confoo 2012
Real time voice call integration - Confoo 2012Real time voice call integration - Confoo 2012
Real time voice call integration - Confoo 2012
 
Confoo 2011-planifier-accessibilite-dans-votre-organisation
Confoo 2011-planifier-accessibilite-dans-votre-organisationConfoo 2011-planifier-accessibilite-dans-votre-organisation
Confoo 2011-planifier-accessibilite-dans-votre-organisation
 
Back Alleys of ruby
Back Alleys of rubyBack Alleys of ruby
Back Alleys of ruby
 
One Click Deployment with Jenkins
One Click Deployment with JenkinsOne Click Deployment with Jenkins
One Click Deployment with Jenkins
 
A great attitude -presentation
A great attitude -presentationA great attitude -presentation
A great attitude -presentation
 
The top 10 web application intrusion techniques
The top 10 web application intrusion techniquesThe top 10 web application intrusion techniques
The top 10 web application intrusion techniques
 
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)
SimpleVOC OPEN – Yet another Memcached? (Froscon 2010 talk, german)
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 

Semelhante a Javascript debugging logging

Mobile Anwendungsentwicklung mit Webtechnologien
Mobile Anwendungsentwicklung mit WebtechnologienMobile Anwendungsentwicklung mit Webtechnologien
Mobile Anwendungsentwicklung mit WebtechnologienMayflower GmbH
 
Responsive Webdesign: Fiese Fallstricke und sexy Strategien
Responsive Webdesign: Fiese Fallstricke und sexy StrategienResponsive Webdesign: Fiese Fallstricke und sexy Strategien
Responsive Webdesign: Fiese Fallstricke und sexy StrategienJohannes Weber
 
Shell Fu for Developers
Shell Fu for DevelopersShell Fu for Developers
Shell Fu for DevelopersMayflower GmbH
 
Mobile Anwendungen mit SenchaTouch
Mobile Anwendungen mit SenchaTouchMobile Anwendungen mit SenchaTouch
Mobile Anwendungen mit SenchaTouchMayflower GmbH
 
ABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesVirtual Forge
 
Fine tuning Lotus Script (german)
Fine tuning Lotus Script (german)Fine tuning Lotus Script (german)
Fine tuning Lotus Script (german)dominion
 
Disruptive Kraft von Open Source im E-Commerce
Disruptive Kraft von Open Source im E-CommerceDisruptive Kraft von Open Source im E-Commerce
Disruptive Kraft von Open Source im E-CommerceMayflower GmbH
 
DevOps für PHP (und andere)
DevOps für PHP (und andere)DevOps für PHP (und andere)
DevOps für PHP (und andere)Mayflower GmbH
 
Präsentation plug in development
Präsentation plug in developmentPräsentation plug in development
Präsentation plug in developmentxxtesaxx
 

Semelhante a Javascript debugging logging (13)

Mobile Anwendungsentwicklung mit Webtechnologien
Mobile Anwendungsentwicklung mit WebtechnologienMobile Anwendungsentwicklung mit Webtechnologien
Mobile Anwendungsentwicklung mit Webtechnologien
 
BDD
BDDBDD
BDD
 
Responsive Webdesign: Fiese Fallstricke und sexy Strategien
Responsive Webdesign: Fiese Fallstricke und sexy StrategienResponsive Webdesign: Fiese Fallstricke und sexy Strategien
Responsive Webdesign: Fiese Fallstricke und sexy Strategien
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Shell Fu for Developers
Shell Fu for DevelopersShell Fu for Developers
Shell Fu for Developers
 
Mobile Anwendungen mit SenchaTouch
Mobile Anwendungen mit SenchaTouchMobile Anwendungen mit SenchaTouch
Mobile Anwendungen mit SenchaTouch
 
ABAP Code Qualität - Best Practices
ABAP Code Qualität - Best PracticesABAP Code Qualität - Best Practices
ABAP Code Qualität - Best Practices
 
Dev ops für php
Dev ops für phpDev ops für php
Dev ops für php
 
Fine tuning Lotus Script (german)
Fine tuning Lotus Script (german)Fine tuning Lotus Script (german)
Fine tuning Lotus Script (german)
 
Disruptive Kraft von Open Source im E-Commerce
Disruptive Kraft von Open Source im E-CommerceDisruptive Kraft von Open Source im E-Commerce
Disruptive Kraft von Open Source im E-Commerce
 
DevOps für PHP (und andere)
DevOps für PHP (und andere)DevOps für PHP (und andere)
DevOps für PHP (und andere)
 
Dev ops für php talk
Dev ops für php talkDev ops für php talk
Dev ops für php talk
 
Präsentation plug in development
Präsentation plug in developmentPräsentation plug in development
Präsentation plug in development
 

Mais de Mayflower GmbH

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mayflower GmbH
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: SecurityMayflower GmbH
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftMayflower GmbH
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientMayflower GmbH
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingMayflower GmbH
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...Mayflower GmbH
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyMayflower GmbH
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming MythbustersMayflower GmbH
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im GlückMayflower GmbH
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefernMayflower GmbH
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsMayflower GmbH
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalierenMayflower GmbH
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastMayflower GmbH
 

Mais de Mayflower GmbH (20)

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
 
Usability im web
Usability im webUsability im web
Usability im web
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
 

Javascript debugging logging

  • 1. J avaScript Best Practise Debugging und Logging Martin Ruprecht I 03. Februar 2011 ©Mayflower GmbH 2011
  • 4. 1997 alert( ) Mayflower GmbH I 4
  • 5. 1997 2011 alert( ) console.log( ) Mayflower GmbH I 5
  • 6. 1997 2010 201* alert( ) console.log( ) Mayflower GmbH I 6
  • 7. 1997 2010 201* alert( ) console.log( ) „HTML5 is about moving from documents to applications and from hacks to solutions.“ – Chris Heilmann, Mozilla Foundation Mayflower GmbH I 7
  • 8. Tools Mayflower GmbH I 8
  • 9. Tools I Firebug, Firebug Lite I Entwickler Tools (IE und Chrome) I Webinspector Safari I Web Developer Toolbar I YSLOW (Performance Debugging) I CompanionJS I Fiddler I ... Mayflower GmbH I 9
  • 10. Firebug? Webinspector? Entwickler Tools? I Shortcuts ·Ctrl + A, Ctrl + C, Ctrl + V, Pfeil nach oben I Autocomplete mit TAB I *.toString( ) I *.toJson( ) Mayflower GmbH I 10
  • 11. Debugging Strategien I Untersuchen von HTML-Elementen I Aufzeichnen von Log-Nachrichten I Breakpoints I Prototyping Mayflower GmbH I 11
  • 12. Untersuchen von HTML-Elementen Mayflower GmbH I 12
  • 13. Aufzeichnen von Log-Nachrichten I console.log/warn/error/info/exception/assert · Unterschiedliche Ausgabe nach Level in Konsole I console.dir(object ) · Schreibt object formatiert in die Konsole I console.count( ) · Zähler, z.B. für Funktionsaufrufe Mayflower GmbH I 13
  • 14. Aufzeichnen von Log-Nachrichten Mayflower GmbH I 14
  • 15. Breakpoints I debugger; I Individuelle Breakpoints I Conditional Breakpoints Mayflower GmbH I 15
  • 16. Fehler gefunden? I Stack Trace · console.trace( ) I Live Fixen / Testen / weiter entwickeln Mayflower GmbH I 16
  • 17. Fehler nicht gefunden? I Google I Kollegen fragen I kurze Pause machen I genaue Problemdefinition Mayflower GmbH I 17
  • 18. Fazit: Real life logging I Logging auch an den Server I unabhängig vom Browser einsetzbar I auch in Produktion I unterschiedliche Levels Mayflower GmbH I 18
  • 19. DEMO Mayflower GmbH I 19
  • 20. Vielen Dank für Ihre Aufmerksamkeit! Kontakt Martin Ruprecht martin.ruprecht@mayflower.de +49 89 242054 1116 Mayflower GmbH Mannhardtstrasse6 80538 München 14.03.11 Mayflower GmbH 20