{"id":6838,"date":"2016-08-30T14:40:37","date_gmt":"2016-08-30T12:40:37","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6838"},"modified":"2016-08-30T14:40:37","modified_gmt":"2016-08-30T12:40:37","slug":"javascript-console","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/08\/30\/javascript-console\/","title":{"rendered":"JavaScript: console \u2014 debugging output"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/library.oreilly.com\/book\/9780596805531\/javascript-the-definitive-guide\/770.xhtml\">https:\/\/library.oreilly.com\/book\/9780596805531\/javascript-the-definitive-guide\/770.xhtml<\/a>\u00a0\u2013 console<\/li>\n<li><a href=\"https:\/\/getfirebug.com\/wiki\/index.php\/Console.log\">https:\/\/getfirebug.com\/wiki\/index.php\/Console.log<\/a><\/li>\n<\/ul>\n<p>How to display trace code in JavaScript?<\/p>\n<p>I came across code using &#8220;alert&#8221;, but I found it annoying, that I have to confirm every single message.<\/p>\n<p>console.log(\u2026) and console.debug(\u2026) instead do not work like that. But I found that the output of console.log(\u2026) resp. console.debug(\u2026) appear quite <strong>a little delayed. I wondered why that is so.<\/strong><\/p>\n<p>Because the software I am working on already creates tons of lines in the console window, I need to make my output stand out a little, &#8220;%c&#8221; is good for that:<\/p>\n<pre>console.debug(\"%c=%s: %s=&gt;{%s} \/\/ %snnn\",\"color:green; background-color:yellow\",proc_name, ...);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/library.oreilly.com\/book\/9780596805531\/javascript-the-definitive-guide\/770.xhtml\u00a0\u2013 console https:\/\/getfirebug.com\/wiki\/index.php\/Console.log How to display trace code in JavaScript? I came across code using &#8220;alert&#8221;, but I found it annoying, that I have to confirm every single message. console.log(\u2026) and console.debug(\u2026) instead do not work like that. But I found that the output of console.log(\u2026) resp. console.debug(\u2026) appear quite a little delayed. I wondered [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-6838","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1Mi","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6838"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6838\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}