Files
nexus/sreweekly/articles/96/02-log20-fully-automated-optimal-placement-of-log-printing-statements-und.html
2026-09-12 17:23:01 +08:00

1006 lines
120 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<title>Log20: Fully automated optimal placement of log printing statements under specified overhead threshold &#8211; the morning paper</title>
<meta name='robots' content='max-image-preview:large' />
<!-- Async WordPress.com Remote Login -->
<script id="wpcom_remote_login_js">
var wpcom_remote_login_extra_auth = '';
function wpcom_remote_login_remove_dom_node_id( element_id ) {
var dom_node = document.getElementById( element_id );
if ( dom_node ) { dom_node.parentNode.removeChild( dom_node ); }
}
function wpcom_remote_login_remove_dom_node_classes( class_name ) {
var dom_nodes = document.querySelectorAll( '.' + class_name );
for ( var i = 0; i < dom_nodes.length; i++ ) {
dom_nodes[ i ].parentNode.removeChild( dom_nodes[ i ] );
}
}
function wpcom_remote_login_final_cleanup() {
wpcom_remote_login_remove_dom_node_classes( "wpcom_remote_login_msg" );
wpcom_remote_login_remove_dom_node_id( "wpcom_remote_login_key" );
wpcom_remote_login_remove_dom_node_id( "wpcom_remote_login_validate" );
wpcom_remote_login_remove_dom_node_id( "wpcom_remote_login_js" );
wpcom_remote_login_remove_dom_node_id( "wpcom_request_access_iframe" );
wpcom_remote_login_remove_dom_node_id( "wpcom_request_access_styles" );
}
// Watch for messages back from the remote login
window.addEventListener( "message", function( e ) {
if ( e.origin === "https://r-login.wordpress.com" ) {
var data = {};
try {
data = JSON.parse( e.data );
} catch( e ) {
wpcom_remote_login_final_cleanup();
return;
}
if ( data.msg === 'LOGIN' ) {
// Clean up the login check iframe
wpcom_remote_login_remove_dom_node_id( "wpcom_remote_login_key" );
var id_regex = new RegExp( /^[0-9]+$/ );
var token_regex = new RegExp( /^.*|.*|.*$/ );
if (
token_regex.test( data.token )
&& id_regex.test( data.wpcomid )
) {
// We have everything we need to ask for a login
var script = document.createElement( "script" );
script.setAttribute( "id", "wpcom_remote_login_validate" );
script.src = '/remote-login.php?wpcom_remote_login=validate'
+ '&wpcomid=' + data.wpcomid
+ '&token=' + encodeURIComponent( data.token )
+ '&host=' + window.location.protocol
+ '//' + window.location.hostname
+ '&postid=5994'
+ '&is_singular=1';
document.body.appendChild( script );
}
return;
}
// Safari ITP, not logged in, so redirect
if ( data.msg === 'LOGIN-REDIRECT' ) {
window.location = 'https://wordpress.com/log-in?redirect_to=' + window.location.href;
return;
}
// Safari ITP, storage access failed, remove the request
if ( data.msg === 'LOGIN-REMOVE' ) {
var css_zap = 'html { -webkit-transition: margin-top 1s; transition: margin-top 1s; } /* 9001 */ html { margin-top: 0 !important; } * html body { margin-top: 0 !important; } @media screen and ( max-width: 782px ) { html { margin-top: 0 !important; } * html body { margin-top: 0 !important; } }';
var style_zap = document.createElement( 'style' );
style_zap.type = 'text/css';
style_zap.appendChild( document.createTextNode( css_zap ) );
document.body.appendChild( style_zap );
var e = document.getElementById( 'wpcom_request_access_iframe' );
e.parentNode.removeChild( e );
document.cookie = 'wordpress_com_login_access=denied; path=/; max-age=31536000';
return;
}
// Safari ITP
if ( data.msg === 'REQUEST_ACCESS' ) {
console.log( 'request access: safari' );
// Check ITP iframe enable/disable knob
if ( wpcom_remote_login_extra_auth !== 'safari_itp_iframe' ) {
return;
}
// If we are in a "private window" there is no ITP.
var private_window = false;
try {
var opendb = window.openDatabase( null, null, null, null );
} catch( e ) {
private_window = true;
}
if ( private_window ) {
console.log( 'private window' );
return;
}
var iframe = document.createElement( 'iframe' );
iframe.id = 'wpcom_request_access_iframe';
iframe.setAttribute( 'scrolling', 'no' );
iframe.setAttribute( 'sandbox', 'allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-top-navigation-by-user-activation' );
iframe.src = 'https://r-login.wordpress.com/remote-login.php?wpcom_remote_login=request_access&origin=' + encodeURIComponent( data.origin ) + '&wpcomid=' + encodeURIComponent( data.wpcomid );
var css = 'html { -webkit-transition: margin-top 1s; transition: margin-top 1s; } /* 9001 */ html { margin-top: 46px !important; } * html body { margin-top: 46px !important; } @media screen and ( max-width: 660px ) { html { margin-top: 71px !important; } * html body { margin-top: 71px !important; } #wpcom_request_access_iframe { display: block; height: 71px !important; } } #wpcom_request_access_iframe { border: 0px; height: 46px; position: fixed; top: 0; left: 0; width: 100%; min-width: 100%; z-index: 99999; background: #23282d; } ';
var style = document.createElement( 'style' );
style.type = 'text/css';
style.id = 'wpcom_request_access_styles';
style.appendChild( document.createTextNode( css ) );
document.body.appendChild( style );
document.body.appendChild( iframe );
}
if ( data.msg === 'DONE' ) {
wpcom_remote_login_final_cleanup();
}
}
}, false );
// Inject the remote login iframe after the page has had a chance to load
// more critical resources
window.addEventListener( "DOMContentLoaded", function( e ) {
var iframe = document.createElement( "iframe" );
iframe.style.display = "none";
iframe.setAttribute( "scrolling", "no" );
iframe.setAttribute( "id", "wpcom_remote_login_key" );
iframe.src = "https://r-login.wordpress.com/remote-login.php"
+ "?wpcom_remote_login=key"
+ "&origin=aHR0cHM6Ly9ibG9nLmFjb2x5ZXIub3Jn"
+ "&wpcomid=23592848"
+ "&time=" + Math.floor( Date.now() / 1000 );
document.body.appendChild( iframe );
}, false );
</script>
<link rel='dns-prefetch' href='//s2.wp.com' />
<link rel='dns-prefetch' href='//fonts-api.wp.com' />
<link rel='dns-prefetch' href='//s1.wp.com' />
<link rel='dns-prefetch' href='//s0.wp.com' />
<link rel="alternate" type="application/rss+xml" title="the morning paper &raquo; Feed" href="https://blog.acolyer.org/feed/" />
<link rel="alternate" type="application/rss+xml" title="the morning paper &raquo; Comments Feed" href="https://blog.acolyer.org/comments/feed/" />
<link rel="alternate" type="application/rss+xml" title="the morning paper &raquo; Log20: Fully automated optimal placement of log printing statements under specified overhead&nbsp;threshold Comments Feed" href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/feed/" />
<script type="text/javascript">
/* <![CDATA[ */
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function () {
oldonload();
func();
}
}
}
/* ]]> */
</script>
<style id="wp-img-auto-sizes-contain-inline-css">
img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px}
/*# sourceURL=wp-img-auto-sizes-contain-inline-css */
</style>
<link crossorigin='anonymous' rel='stylesheet' id='all-css-2-1' href='/_static/??-eJxtjEsKgDAMBS9kjbqwuBDPUtog9o9J8fpaEQSRBw8GhoEjC50iY2QIRWRf1i0SWOSstHsYQkr1TPFIsKNXjEbkRPyhVhM18J/0m8M3fFPVlzD3UnbTtWG0J2CTNNk=&cssminify=yes' type='text/css' media='all' />
<style id="wp-emoji-styles-inline-css">
img.wp-smiley, img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 0.07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
/*# sourceURL=wp-emoji-styles-inline-css */
</style>
<style id="wp-block-library-inline-css">
:root{--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223;--wp-bound-block-color:var(--wp-block-synced-color);--wp-editor-canvas-background:#ddd;--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,160.5;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.wp-element-button{cursor:pointer}:root .has-very-light-gray-background-color{background-color:#eee}:root .has-very-dark-gray-background-color{background-color:#313131}:root .has-very-light-gray-color{color:#eee}:root .has-very-dark-gray-color{color:#313131}:root .has-vivid-green-cyan-to-vivid-cyan-blue-gradient-background{background:linear-gradient(135deg,#00d084,#0693e3)}:root .has-purple-crush-gradient-background{background:linear-gradient(135deg,#34e2e4,#4721fb 50%,#ab1dfe)}:root .has-hazy-dawn-gradient-background{background:linear-gradient(135deg,#faaca8,#dad0ec)}:root .has-subdued-olive-gradient-background{background:linear-gradient(135deg,#fafae1,#67a671)}:root .has-atomic-cream-gradient-background{background:linear-gradient(135deg,#fdd79a,#004a59)}:root .has-nightshade-gradient-background{background:linear-gradient(135deg,#330968,#31cdcf)}:root .has-midnight-gradient-background{background:linear-gradient(135deg,#020381,#2874fc)}:root{--wp--preset--font-size--normal:16px;--wp--preset--font-size--huge:42px}.has-regular-font-size{font-size:1em}.has-larger-font-size{font-size:2.625em}.has-normal-font-size{font-size:var(--wp--preset--font-size--normal)}.has-huge-font-size{font-size:var(--wp--preset--font-size--huge)}:root .has-text-align-center{text-align:center}:root .has-text-align-left{text-align:left}:root .has-text-align-right{text-align:right}.has-fit-text{white-space:nowrap!important}#end-resizable-editor-section{display:none}.aligncenter{clear:both}.items-justified-left{justify-content:flex-start}.items-justified-center{justify-content:center}.items-justified-right{justify-content:flex-end}.items-justified-space-between{justify-content:space-between}.screen-reader-text{word-wrap:normal!important;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal!important}.screen-reader-text:focus{background-color:#ddd;clip-path:none;color:#444;display:block;font-size:1em;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}html :where(.has-border-color){border-style:solid}html :where([style^=border-color],[style*=";border-color"],[style*="; border-color"]){border-style:solid}html :where([style^=border-top-color],[style*=";border-top-color"],[style*="; border-top-color"]){border-top-style:solid}html :where([style^=border-right-color],[style*=";border-right-color"],[style*="; border-right-color"]){border-right-style:solid}html :where([style^=border-bottom-color],[style*=";border-bottom-color"],[style*="; border-bottom-color"]){border-bottom-style:solid}html :where([style^=border-left-color],[style*=";border-left-color"],[style*="; border-left-color"]){border-left-style:solid}html :where([style^=border-width],[style*=";border-width"],[style*="; border-width"]){border-style:solid}html :where([style^=border-top-width],[style*=";border-top-width"],[style*="; border-top-width"]){border-top-style:solid}html :where([style^=border-right-width],[style*=";border-right-width"],[style*="; border-right-width"]){border-right-style:solid}html :where([style^=border-bottom-width],[style*=";border-bottom-width"],[style*="; border-bottom-width"]){border-bottom-style:solid}html :where([style^=border-left-width],[style*=";border-left-width"],[style*="; border-left-width"]){border-left-style:solid}html :where(img[class*=wp-image-]){height:auto;max-width:100%}:where(figure){margin:0 0 1em}html :where(.is-position-sticky){--wp-admin--admin-bar--position-offset:var(--wp-admin--admin-bar--height,0px)}@media screen and (max-width:600px){html :where(.is-position-sticky){--wp-admin--admin-bar--position-offset:0px}}
/*# sourceURL=/wp-content/plugins/gutenberg-core/v23.9.1/build/styles/block-library/common.min.css */
</style>
<style id="wp-block-library-inline-css-extra">
.has-text-align-justify {
text-align:justify;
}
.has-text-align-justify{text-align:justify;}
/*# sourceURL=wp-block-library-inline-css */
</style>
<style id="classic-theme-styles-inline-css">
.wp-block-button__link{background-color:#32373c;border-radius:9999px;box-shadow:none;color:#fff;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-file__button{background:#32373c;color:#fff}.wp-block-accordion-heading{margin:0}.wp-block-accordion-heading__toggle{background-color:inherit!important;color:inherit!important}.wp-block-accordion-heading__toggle:not(:focus-visible){outline:none}.wp-block-accordion-heading__toggle:focus,.wp-block-accordion-heading__toggle:hover{background-color:inherit!important;border:none;box-shadow:none;color:inherit;padding:var(--wp--preset--spacing--20,1em) 0;text-decoration:none}.wp-block-accordion-heading__toggle:focus-visible{outline:auto;outline-offset:0}.wp-block-tab:not(.has-text-color){color:inherit!important}.wp-block-tab:not(.has-background){background-color:inherit!important}.wp-block-tab:focus,.wp-block-tab:hover{text-decoration:none}.wp-block-tab:focus-visible{outline:auto;outline-offset:0}
/*# sourceURL=/wp-content/plugins/gutenberg-core/v23.9.1/build/styles/block-library/classic.min.css */
</style>
<style id="coblocks-inline-format-inline-css">
.uppercase{text-transform:uppercase}
/*# sourceURL=coblocks-inline-format-inline-css */
</style>
<link crossorigin='anonymous' rel='stylesheet' id='all-css-12-1' href='/_static/??/wp-content/mu-plugins/core-compat/wp-mediaelement.css,/wp-content/mu-plugins/wpcom-bbpress-premium-themes.css?m=1432920480j&cssminify=yes' type='text/css' media='all' />
<style id="global-styles-inline-css">
:root{--wp--preset--aspect-ratio--square: 1;--wp--preset--aspect-ratio--4-3: 4/3;--wp--preset--aspect-ratio--3-4: 3/4;--wp--preset--aspect-ratio--3-2: 3/2;--wp--preset--aspect-ratio--2-3: 2/3;--wp--preset--aspect-ratio--16-9: 16/9;--wp--preset--aspect-ratio--9-16: 9/16;--wp--preset--color--black: #000000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #fff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--color--dark-green: #1c7c7c;--wp--preset--color--dark-gray: #666;--wp--preset--color--medium-gray: #999;--wp--preset--color--light-gray: #eee;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;--wp--preset--font-family--albert-sans: 'Albert Sans', sans-serif;--wp--preset--font-family--alegreya: Alegreya, serif;--wp--preset--font-family--arvo: Arvo, serif;--wp--preset--font-family--bodoni-moda: 'Bodoni Moda', serif;--wp--preset--font-family--bricolage-grotesque: 'Bricolage Grotesque', sans-serif;--wp--preset--font-family--cabin: Cabin, sans-serif;--wp--preset--font-family--chivo: Chivo, sans-serif;--wp--preset--font-family--commissioner: Commissioner, sans-serif;--wp--preset--font-family--cormorant: Cormorant, serif;--wp--preset--font-family--courier-prime: 'Courier Prime', monospace;--wp--preset--font-family--crimson-pro: 'Crimson Pro', serif;--wp--preset--font-family--dm-mono: 'DM Mono', monospace;--wp--preset--font-family--dm-sans: 'DM Sans', sans-serif;--wp--preset--font-family--dm-serif-display: 'DM Serif Display', serif;--wp--preset--font-family--domine: Domine, serif;--wp--preset--font-family--eb-garamond: 'EB Garamond', serif;--wp--preset--font-family--epilogue: Epilogue, sans-serif;--wp--preset--font-family--fahkwang: Fahkwang, sans-serif;--wp--preset--font-family--figtree: Figtree, sans-serif;--wp--preset--font-family--fira-sans: 'Fira Sans', sans-serif;--wp--preset--font-family--fjalla-one: 'Fjalla One', sans-serif;--wp--preset--font-family--fraunces: Fraunces, serif;--wp--preset--font-family--gabarito: Gabarito, system-ui;--wp--preset--font-family--ibm-plex-mono: 'IBM Plex Mono', monospace;--wp--preset--font-family--ibm-plex-sans: 'IBM Plex Sans', sans-serif;--wp--preset--font-family--ibarra-real-nova: 'Ibarra Real Nova', serif;--wp--preset--font-family--instrument-serif: 'Instrument Serif', serif;--wp--preset--font-family--inter: Inter, sans-serif;--wp--preset--font-family--josefin-sans: 'Josefin Sans', sans-serif;--wp--preset--font-family--jost: Jost, sans-serif;--wp--preset--font-family--libre-baskerville: 'Libre Baskerville', serif;--wp--preset--font-family--libre-franklin: 'Libre Franklin', sans-serif;--wp--preset--font-family--literata: Literata, serif;--wp--preset--font-family--lora: Lora, serif;--wp--preset--font-family--merriweather: Merriweather, serif;--wp--preset--font-family--montserrat: Montserrat, sans-serif;--wp--preset--font-family--newsreader: Newsreader, serif;--wp--preset--font-family--noto-sans-mono: 'Noto Sans Mono', sans-serif;--wp--preset--font-family--nunito: Nunito, sans-serif;--wp--preset--font-family--open-sans: 'Open Sans', sans-serif;--wp--preset--font-family--overpass: Overpass, sans-serif;--wp--preset--font-family--pt-serif: 'PT Serif', serif;--wp--preset--font-family--petrona: Petrona, serif;--wp--preset--font-family--piazzolla: Piazzolla, serif;--wp--preset--font-family--playfair-display: 'Playfair Display', serif;--wp--preset--font-family--plus-jakarta-sans: 'Plus Jakarta Sans', sans-serif;--wp--preset--font-family--poppins: Poppins, sans-serif;--wp--preset--font-family--raleway: Raleway, sans-serif;--wp--preset--font-family--roboto: Roboto, sans-serif;--wp--preset--font-family--roboto-slab: 'Roboto Slab', serif;--wp--preset--font-family--rubik: Rubik, sans-serif;--wp--preset--font-family--rufina: Rufina, serif;--wp--preset--font-family--sora: Sora, sans-serif;--wp--preset--font-family--source-sans-3: 'Source Sans 3', sans-serif;--wp--preset--font-family--source-serif-4: 'Source Serif 4', serif;--wp--preset--font-family--space-mono: 'Space Mono', monospace;--wp--preset--font-family--syne: Syne, sans-serif;--wp--preset--font-family--texturina: Texturina, serif;--wp--preset--font-family--urbanist: Urbanist, sans-serif;--wp--preset--font-family--work-sans: 'Work Sans', sans-serif;--wp--preset--spacing--20: 0.44rem;--wp--preset--spacing--30: 0.67rem;--wp--preset--spacing--40: 1rem;--wp--preset--spacing--50: 1.5rem;--wp--preset--spacing--60: 2.25rem;--wp--preset--spacing--70: 3.38rem;--wp--preset--spacing--80: 5.06rem;--wp--preset--shadow--natural: 6px 6px 9px rgba(0, 0, 0, 0.2);--wp--preset--shadow--deep: 12px 12px 50px rgba(0, 0, 0, 0.4);--wp--preset--shadow--sharp: 6px 6px 0px rgba(0, 0, 0, 0.2);--wp--preset--shadow--outlined: 6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0);--wp--preset--shadow--crisp: 6px 6px 0px rgb(0, 0, 0);}.wp-block-button{--wp--preset--dimension--25: 25%;--wp--preset--dimension--50: 50%;--wp--preset--dimension--75: 75%;--wp--preset--dimension--100: 100%;}:where(body) { margin: 0; }:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}body{padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;}:root :where(.wp-element-button, .wp-block-button__link){background-color: #32373c;border-width: 0;color: #fff;font-family: inherit;font-size: inherit;font-style: inherit;font-weight: inherit;letter-spacing: inherit;line-height: inherit;padding-top: calc(0.667em + 2px);padding-right: calc(1.333em + 2px);padding-bottom: calc(0.667em + 2px);padding-left: calc(1.333em + 2px);text-decoration: none;text-transform: inherit;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-dark-green-color{color: var(--wp--preset--color--dark-green) !important;}.has-dark-gray-color{color: var(--wp--preset--color--dark-gray) !important;}.has-medium-gray-color{color: var(--wp--preset--color--medium-gray) !important;}.has-light-gray-color{color: var(--wp--preset--color--light-gray) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-dark-green-background-color{background-color: var(--wp--preset--color--dark-green) !important;}.has-dark-gray-background-color{background-color: var(--wp--preset--color--dark-gray) !important;}.has-medium-gray-background-color{background-color: var(--wp--preset--color--medium-gray) !important;}.has-light-gray-background-color{background-color: var(--wp--preset--color--light-gray) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-dark-green-border-color{border-color: var(--wp--preset--color--dark-green) !important;}.has-dark-gray-border-color{border-color: var(--wp--preset--color--dark-gray) !important;}.has-medium-gray-border-color{border-color: var(--wp--preset--color--medium-gray) !important;}.has-light-gray-border-color{border-color: var(--wp--preset--color--light-gray) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;}.has-albert-sans-font-family{font-family: var(--wp--preset--font-family--albert-sans) !important;}.has-alegreya-font-family{font-family: var(--wp--preset--font-family--alegreya) !important;}.has-arvo-font-family{font-family: var(--wp--preset--font-family--arvo) !important;}.has-bodoni-moda-font-family{font-family: var(--wp--preset--font-family--bodoni-moda) !important;}.has-bricolage-grotesque-font-family{font-family: var(--wp--preset--font-family--bricolage-grotesque) !important;}.has-cabin-font-family{font-family: var(--wp--preset--font-family--cabin) !important;}.has-chivo-font-family{font-family: var(--wp--preset--font-family--chivo) !important;}.has-commissioner-font-family{font-family: var(--wp--preset--font-family--commissioner) !important;}.has-cormorant-font-family{font-family: var(--wp--preset--font-family--cormorant) !important;}.has-courier-prime-font-family{font-family: var(--wp--preset--font-family--courier-prime) !important;}.has-crimson-pro-font-family{font-family: var(--wp--preset--font-family--crimson-pro) !important;}.has-dm-mono-font-family{font-family: var(--wp--preset--font-family--dm-mono) !important;}.has-dm-sans-font-family{font-family: var(--wp--preset--font-family--dm-sans) !important;}.has-dm-serif-display-font-family{font-family: var(--wp--preset--font-family--dm-serif-display) !important;}.has-domine-font-family{font-family: var(--wp--preset--font-family--domine) !important;}.has-eb-garamond-font-family{font-family: var(--wp--preset--font-family--eb-garamond) !important;}.has-epilogue-font-family{font-family: var(--wp--preset--font-family--epilogue) !important;}.has-fahkwang-font-family{font-family: var(--wp--preset--font-family--fahkwang) !important;}.has-figtree-font-family{font-family: var(--wp--preset--font-family--figtree) !important;}.has-fira-sans-font-family{font-family: var(--wp--preset--font-family--fira-sans) !important;}.has-fjalla-one-font-family{font-family: var(--wp--preset--font-family--fjalla-one) !important;}.has-fraunces-font-family{font-family: var(--wp--preset--font-family--fraunces) !important;}.has-gabarito-font-family{font-family: var(--wp--preset--font-family--gabarito) !important;}.has-ibm-plex-mono-font-family{font-family: var(--wp--preset--font-family--ibm-plex-mono) !important;}.has-ibm-plex-sans-font-family{font-family: var(--wp--preset--font-family--ibm-plex-sans) !important;}.has-ibarra-real-nova-font-family{font-family: var(--wp--preset--font-family--ibarra-real-nova) !important;}.has-instrument-serif-font-family{font-family: var(--wp--preset--font-family--instrument-serif) !important;}.has-inter-font-family{font-family: var(--wp--preset--font-family--inter) !important;}.has-josefin-sans-font-family{font-family: var(--wp--preset--font-family--josefin-sans) !important;}.has-jost-font-family{font-family: var(--wp--preset--font-family--jost) !important;}.has-libre-baskerville-font-family{font-family: var(--wp--preset--font-family--libre-baskerville) !important;}.has-libre-franklin-font-family{font-family: var(--wp--preset--font-family--libre-franklin) !important;}.has-literata-font-family{font-family: var(--wp--preset--font-family--literata) !important;}.has-lora-font-family{font-family: var(--wp--preset--font-family--lora) !important;}.has-merriweather-font-family{font-family: var(--wp--preset--font-family--merriweather) !important;}.has-montserrat-font-family{font-family: var(--wp--preset--font-family--montserrat) !important;}.has-newsreader-font-family{font-family: var(--wp--preset--font-family--newsreader) !important;}.has-noto-sans-mono-font-family{font-family: var(--wp--preset--font-family--noto-sans-mono) !important;}.has-nunito-font-family{font-family: var(--wp--preset--font-family--nunito) !important;}.has-open-sans-font-family{font-family: var(--wp--preset--font-family--open-sans) !important;}.has-overpass-font-family{font-family: var(--wp--preset--font-family--overpass) !important;}.has-pt-serif-font-family{font-family: var(--wp--preset--font-family--pt-serif) !important;}.has-petrona-font-family{font-family: var(--wp--preset--font-family--petrona) !important;}.has-piazzolla-font-family{font-family: var(--wp--preset--font-family--piazzolla) !important;}.has-playfair-display-font-family{font-family: var(--wp--preset--font-family--playfair-display) !important;}.has-plus-jakarta-sans-font-family{font-family: var(--wp--preset--font-family--plus-jakarta-sans) !important;}.has-poppins-font-family{font-family: var(--wp--preset--font-family--poppins) !important;}.has-raleway-font-family{font-family: var(--wp--preset--font-family--raleway) !important;}.has-roboto-font-family{font-family: var(--wp--preset--font-family--roboto) !important;}.has-roboto-slab-font-family{font-family: var(--wp--preset--font-family--roboto-slab) !important;}.has-rubik-font-family{font-family: var(--wp--preset--font-family--rubik) !important;}.has-rufina-font-family{font-family: var(--wp--preset--font-family--rufina) !important;}.has-sora-font-family{font-family: var(--wp--preset--font-family--sora) !important;}.has-source-sans-3-font-family{font-family: var(--wp--preset--font-family--source-sans-3) !important;}.has-source-serif-4-font-family{font-family: var(--wp--preset--font-family--source-serif-4) !important;}.has-space-mono-font-family{font-family: var(--wp--preset--font-family--space-mono) !important;}.has-syne-font-family{font-family: var(--wp--preset--font-family--syne) !important;}.has-texturina-font-family{font-family: var(--wp--preset--font-family--texturina) !important;}.has-urbanist-font-family{font-family: var(--wp--preset--font-family--urbanist) !important;}.has-work-sans-font-family{font-family: var(--wp--preset--font-family--work-sans) !important;}
/*# sourceURL=global-styles-inline-css */
</style>
<link crossorigin='anonymous' rel='stylesheet' id='all-css-14-1' href='/_static/??/wp-content/themes/pub/penscratch-2/css/reset.css,/wp-content/themes/pub/penscratch-2/style.css?m=1779214100j&cssminify=yes' type='text/css' media='all' />
<style id="penscratch-2-style-inline-css">
.cat-links, .byline .author, .group-blog .byline + .sep, .single .byline + .sep { clip: rect(1px, 1px, 1px, 1px); height: 1px; position: absolute; overflow: hidden; width: 1px; }
/*# sourceURL=penscratch-2-style-inline-css */
</style>
<link rel='stylesheet' id='penscratch-2-fonts-css' href='https://fonts-api.wp.com/css?family=Roboto+Slab%3A300%2C400%2C700&#038;subset=latin%2Clatin-ext' media='all' />
<link crossorigin='anonymous' rel='stylesheet' id='all-css-16-1' href='/_static/??-eJyNjsEKAjEMRH/ImO0iLB7Eb+mG2K22aWmyLP691YuIIN7mHd7M4FaBihiLoS2cWbGuM1YWpeaNFhiRVHFOhW6673GHfyhRCNXuiWGrVPKXl1eoaQ1RFBv37tBjeA298ZcUuEB/5C0W+QC4JB/bUz3nk5um4+gObhiuD4S6VWY=&cssminify=yes' type='text/css' media='all' />
<link crossorigin='anonymous' rel='stylesheet' id='print-css-17-1' href='/wp-content/mu-plugins/global-print/global-print.css?m=1465851035i&cssminify=yes' type='text/css' media='print' />
<style id="jetpack-global-styles-frontend-style-inline-css">
:root { --font-headings: unset; --font-base: unset; --font-headings-default: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; --font-base-default: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;}
/*# sourceURL=jetpack-global-styles-frontend-style-inline-css */
</style>
<link crossorigin='anonymous' rel='stylesheet' id='all-css-20-1' href='/_static/??-eJyNjcEKAjEMRH/ImhVlqwfxU6TbhrZrmhTTIv69u+JFvHgZ5sHwBh7VeOGG3KB0U6nHzAoztur87cNQRNYInVBBk7tjcCE83zVz3HrVDfxvumb2MPVMAVR8dmRIougX/DhbwrK8pwNEksnROriU884e9+PJDnaYXxwFS20=&cssminify=yes' type='text/css' media='all' />
<script id="jetpack_related-posts-js-extra">
var related_posts_js_options = {"post_heading":"h4"};
//# sourceURL=jetpack_related-posts-js-extra
</script>
<script id="wpcom-actionbar-placeholder-js-extra">
var actionbardata = {"siteID":"23592848","postID":"5994","siteURL":"https://blog.acolyer.org","xhrURL":"https://blog.acolyer.org/wp-admin/admin-ajax.php","nonce":"1fb13c386d","isLoggedIn":"","statusMessage":"","subsEmailDefault":"instantly","proxyScriptUrl":"https://s0.wp.com/wp-content/js/wpcom-proxy-request.js?m=1513050504i&amp;ver=20211021","shortlink":"https://wp.me/p1AZzO-1yG","i18n":{"followedText":"New posts from this site will now appear in your \u003Ca href=\"https://wordpress.com/reader\"\u003EReader\u003C/a\u003E","foldBar":"Collapse this bar","unfoldBar":"Expand this bar","shortLinkCopied":"Shortlink copied to clipboard."}};
//# sourceURL=wpcom-actionbar-placeholder-js-extra
</script>
<script id="jetpack-mu-wpcom-settings-js-before">
var JETPACK_MU_WPCOM_SETTINGS = {"assetsUrl":"https://s1.wp.com/wp-content/mu-plugins/jetpack-mu-wpcom-plugin/moon/jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/"};
//# sourceURL=jetpack-mu-wpcom-settings-js-before
</script>
<script crossorigin='anonymous' type='text/javascript' src='/_static/??/wp-content/mu-plugins/jetpack-plugin/moon/_inc/build/related-posts/related-posts.min.js,/wp-content/js/rlt-proxy.js?m=1788798821j'></script>
<script id="rlt-proxy-js-after">
rltInitialize( {"token":null,"iframeOrigins":["https:\/\/widgets.wp.com"]} );
//# sourceURL=rlt-proxy-js-after
</script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://adriancolyer.wordpress.com/xmlrpc.php?rsd" />
<meta name="generator" content="WordPress.com" />
<link rel="canonical" href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/" />
<link rel='shortlink' href='https://wp.me/p1AZzO-1yG' />
<link rel="alternate" type="application/json+oembed" href="https://public-api.wordpress.com/oembed/?format=json&amp;url=https%3A%2F%2Fblog.acolyer.org%2F2017%2F11%2F03%2Flog20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold%2F&amp;for=wpcom-auto-discovery" /><link rel="alternate" type="application/xml+oembed" href="https://public-api.wordpress.com/oembed/?format=xml&amp;url=https%3A%2F%2Fblog.acolyer.org%2F2017%2F11%2F03%2Flog20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold%2F&amp;for=wpcom-auto-discovery" />
<!-- Jetpack Open Graph Tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Log20: Fully automated optimal placement of log printing statements under specified overhead threshold" />
<meta property="og:url" content="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/" />
<meta property="og:description" content="Log20: Fully automated optimal placement of log printing statements under specified overhead threshold Zhao et al., SOSP’17 Logging has become an overloaded term. In this paper logging is used in t…" />
<meta property="article:published_time" content="2017-11-03T06:00:00+00:00" />
<meta property="article:modified_time" content="2017-10-28T19:09:45+00:00" />
<meta property="og:site_name" content="the morning paper" />
<meta property="og:image" content="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-table-1.jpeg?w=480" />
<meta property="og:image:alt" content="" />
<meta property="og:locale" content="en_US" />
<meta property="article:publisher" content="https://www.facebook.com/WordPresscom" />
<meta name="twitter:text:title" content="Log20: Fully automated optimal placement of log printing statements under specified overhead&nbsp;threshold" />
<meta name="twitter:image" content="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-table-1.jpeg?w=144" />
<meta name="twitter:card" content="summary" />
<!-- End Jetpack Open Graph Tags -->
<link rel="shortcut icon" type="image/x-icon" href="https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=32" sizes="16x16" />
<link rel="icon" type="image/x-icon" href="https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=32" sizes="16x16" />
<link rel="apple-touch-icon" href="https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=114" />
<link rel='openid.server' href='https://blog.acolyer.org/?openidserver=1' />
<link rel='openid.delegate' href='https://blog.acolyer.org/' />
<link rel="search" type="application/opensearchdescription+xml" href="https://blog.acolyer.org/osd.xml" title="the morning paper" />
<link rel="search" type="application/opensearchdescription+xml" href="https://s1.wp.com/opensearch.xml" title="WordPress.com" />
<meta name="theme-color" content="#ffffff" />
<meta name="description" content="Log20: Fully automated optimal placement of log printing statements under specified overhead threshold Zhao et al., SOSP’17 Logging has become an overloaded term. In this paper logging is used in the context of recording information about the execution of a piece of software, for the purposes of aiding troubleshooting. For these kind of logging statements&hellip;" />
<style id="custom-background-css">
body.custom-background { background-color: #ffffff; }
</style>
<style type="text/css" id="custom-colors-css"> .widget a:hover,
.site-footer .widget a:hover {
color: #666;
}
.jetpack-social-navigation ul a:hover { color: #FFFFFF;}
body { background-color: #ffffff;}
.jetpack-social-navigation ul a:hover { background-color: #1c7c7c;}
.jetpack-recipe-title { border-color: #1c7c7c;}
.toggled .menu-toggle, .wp_widget_tag_cloud a:hover, .tags-links a:hover { border-color: #1B7878;}
.button:hover, .button:focus, .button:active, button:hover, button:focus, button:active, input[type="button"]:hover, input[type="button"]:focus, input[type="button"]:active, input[type="reset"]:hover, input[type="reset"]:focus, input[type="reset"]:active, input[type="submit"]:hover, input[type="submit"]:focus, input[type="submit"]:active, #infinite-handle span:hover { border-color: #1B7878;}
.button:hover, .button:focus, .button:active, button:hover, button:focus, button:active, input[type="button"]:hover, input[type="button"]:focus, input[type="button"]:active, input[type="reset"]:hover, input[type="reset"]:focus, input[type="reset"]:active, input[type="submit"]:hover, input[type="submit"]:focus, input[type="submit"]:active, #infinite-handle span:hover { color: #1B7878;}
.menu-toggle:hover #menu-icon, .toggled #menu-icon { fill: #1B7878;}
a, a:visited, .site-footer a:hover, .main-navigation li:hover > a, .current_page_item a, .current-menu-item a, .toggled .menu-toggle, .entry-footer a:hover, .entry-meta a:hover, .entry-title a:hover, .site-main .post-navigation .meta-nav, .site-main .paging-navigation .meta-nav, .comment-meta .comment-metadata a:hover, .required, .widget a, #wp-calendar a, .wp_widget_tag_cloud a:hover, #infinite-footer .container a:hover, #infinite-handle span, .tags-links a:hover, .current_page_item a, .current-menu-item a, .current_page_item a:visited, .current-menu-item a:visited { color: #1B7878;}
</style>
<link rel="stylesheet" id="custom-css-css" type="text/css" href="https://s2.wp.com/?custom-css=1&#038;csblog=1AZzO&#038;cscache=6&#038;csrev=16" />
</head>
<body class="wp-singular post-template-default single single-post postid-5994 single-format-standard custom-background wp-embed-responsive wp-theme-pubpenscratch-2 customizer-styles-applied no-sidebar jetpack-reblog-enabled categories-hidden author-hidden custom-colors">
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content">Skip to content</a>
<header id="masthead" class="site-header" role="banner">
<div class="site-branding">
<p class="site-title"><a href="https://blog.acolyer.org/" rel="home">the morning paper</a></p>
<p class="site-description">a random walk through Computer Science research, by Adrian Colyer</p>
</div>
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect x="0" fill="none" width="16" height="16"/><g><path id="menu-icon" d="M0 14h16v-2H0v2zM0 2v2h16V2H0zm0 7h16V7H0v2z"/></g></svg>
Menu </button>
<div class="menu"><ul>
<li class="page_item page-item-2"><a href="https://blog.acolyer.org/about/">About</a></li>
<li class="page_item page-item-8716"><a href="https://blog.acolyer.org/archives/">Archives</a></li>
<li class="page_item page-item-5027"><a href="https://blog.acolyer.org/infoq-quarterly-review-editions/">InfoQ QR Editions</a></li>
<li class="page_item page-item-8713"><a href="https://blog.acolyer.org/search/">Search</a></li>
<li class="page_item page-item-406"><a href="https://blog.acolyer.org/email-subs/">Subscribe</a></li>
<li class="page_item page-item-8719"><a href="https://blog.acolyer.org/tags/">Tags</a></li>
<li class="page_item page-item-6991"><a href="https://blog.acolyer.org/privacy/">Privacy</a></li>
</ul></div>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<div id="content" class="site-content">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<article id="post-5994" class="post-5994 post type-post status-publish format-standard hentry category-uncategorized tag-operations">
<header class="entry-header">
<h1 class="entry-title">Log20: Fully automated optimal placement of log printing statements under specified overhead&nbsp;threshold</h1>
<div class="entry-meta">
<span class="posted-on"><a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/" rel="bookmark"><time class="entry-date published" datetime="2017-11-03T07:00:00+00:00">November 3, 2017</time><time class="updated" datetime="2017-10-28T20:09:45+01:00">October 28, 2017</time></a></span><span class="byline"><span class="author vcard"><span class="sep"> ~ </span><a class="url fn n" href="https://blog.acolyer.org/author/adriancolyer/">adriancolyer</a></span></span> </div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<p><a href="http://www.eecg.toronto.edu/~yuan/papers/p125-Zhao.pdf">Log20: Fully automated optimal placement of log printing statements under specified overhead threshold</a> Zhao et al., <em>SOSP’17</em></p>
<p>Logging has become an overloaded term. In this paper logging is used in the context of recording information about the execution of a piece of software, for the purposes of aiding troubleshooting. For these kind of logging statements there always seem to be a trade-off between log verbosity, logging overhead, and the log actually containing enough useful information to help you diagnose a problem that occurs in the wild. As developers of the system, we tend to put logging statements in places where we think they’ll be useful &#8211; often as a retrospective action after a problem occurred that couldn’t easily be diagnosed!</p>
<p>So it’s interesting to step back for a moment and consider this: if you were starting to instrument a system from scratch, what would an <em>optimal</em> set of logging statements look like? Where would you place those statements and what criteria would you use to decide? If we assume great filtering and searching tools such that log verbosity is less of an issue, then a strawman would be to log every possible branch of execution. That’s optimal from the perspective of having the information needed in the log in order to diagnose any given problem. But we don’t do that because the performance overhead would be unacceptable. This gives us a clue for reframing the problem: what is the most useful information to log given a maximum logging overhead constraint?</p>
<blockquote><p>
This paper presents Log20, a tool that determines a near optimal placement of log printing statements under the constraint of adding less than a specified amount of performance overhead. Log20 does this in an automated way without any human involvement.
</p></blockquote>
<p>Throughout the paper, the abbreviation LPS is used to refer to a <em>Log Printing Statement</em>.</p>
<h3>Logging the manual way</h3>
<p>Here’s an analysis of the number of LPSes at different severity levels in Cassandra, Hadoop, HBase, and ZooKeeper, indicating that developers seem to find plenty of value in recording non-error information in addition to error conditions:</p>
<p><img src="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-table-1.jpeg?w=480" alt="" /></p>
<p>Looking at the revision history of these systems, and following some of the discussion in bug reports, reveals that:</p>
<ul>
<li>Logging statements are often added retrospectively &#8211; 21,642 revisions have the sole purpose of adding log statements, presumably after finding they were needed to diagnose a problem.</li>
<li>Balancing information and overhead is hard &#8211; at what level should a given piece of information be logged? Battles rage back and forth on this in comment threads (and commits!). 2,105 commits only modify a severity level.</li>
<li>Setting the right verbosity level is also hard subjectively &#8211; whether something is an Error or Info for example can depend on the particular workload. </li>
</ul>
<h3>How much information is that set of log statements providing?</h3>
<p>The first and most significant puzzle piece on the journey towards optimal logging is figuring out how much information we’re getting from a particular log statement. Given the placement of a set of logging statements, the authors use an entropy-based model to capture the amount of uncertainty (unpredictability) that remains in figuring out which execution path was taken. We want to place log statements in such a way that entropy is minimised.</p>
<p>Log20 considers execution paths at the block level. That is, an execution path is a sequence of the blocks that the system traversed at runtime. Consider this program:</p>
<p><img src="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-fig-1.jpeg?w=480" alt="" /></p>
<p>Here are some possible execution paths for the program, where blocks are identified by the line number on which they start:</p>
<p><img src="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-table-3.jpeg?w=480" alt="" /></p>
<p>Log20 samples the production system to collect path profiles. Let <img src="https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="p(x)" class="latex" /> be the number of occurrences of path <img src="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="x" class="latex" /> divided by the total number of paths sampled in the system. In other words, <img src="https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="p(x)" class="latex" /> is an estimate of the probability of observing execution path <img src="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="x" class="latex" />. Using Shannon’s entropy we can measure the overall unpredictability in the system as:<br />
<img src="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+p%28x%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="&#92;displaystyle H(X) = - &#92;sum_{x &#92;in X} p(x) &#92;log_2 p(x)" class="latex" /></p>
<p>We instrument a subset of the blocks. When execution follows a given path, it produces a log sequence containing log entries for the instrumented blocks only. Given a log sequence and a placement of log statements, it’s possible therefore that multiple execution paths may give rise to the same log sequence. As a trivial example, suppose that in our placement we have just one LPS in the block on line 2 &#8211; then any of the paths <img src="https://s0.wp.com/latex.php?latex=P_1&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=P_1&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=P_1&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="P_1" class="latex" /> through <img src="https://s0.wp.com/latex.php?latex=P_9&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=P_9&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=P_9&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="P_9" class="latex" /> will result in the same log sequence.</p>
<p>Let the <em>Possible Paths</em> of a log sequence <img src="https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="L_i" class="latex" />, <img src="https://s0.wp.com/latex.php?latex=PP%28L_i%29+%3D+%7BP_i%2C+...%2C+P_j%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=PP%28L_i%29+%3D+%7BP_i%2C+...%2C+P_j%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=PP%28L_i%29+%3D+%7BP_i%2C+...%2C+P_j%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="PP(L_i) = {P_i, ..., P_j}" class="latex" /> be the set of paths that would output <img src="https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=L_i&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="L_i" class="latex" /> when executed.</p>
<p>Given a placement of log statements <img src="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="S" class="latex" />, then we can use entropy to model how much information we are getting from those log statements. Consider <em>a particular log output</em> <img src="https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="L" class="latex" />, the entropy <img src="https://s0.wp.com/latex.php?latex=H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="H_L" class="latex" /> is:<br />
<img src="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BL%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+PP%28L%29%7D+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BL%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+PP%28L%29%7D+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BL%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+PP%28L%29%7D+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="&#92;displaystyle H_{L}(X) = - &#92;sum_{x &#92;in PP(L)} &#92;frac{p(x)}{p(L)} &#92;log_2 &#92;frac{p(x)}{p(L)}" class="latex" /></p>
<p>Where <img src="https://s0.wp.com/latex.php?latex=p%28L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=p%28L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=p%28L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="p(L)" class="latex" /> is the probability of the program taking a path that outputs L. <img src="https://s0.wp.com/latex.php?latex=%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%5Cfrac%7Bp%28x%29%7D%7Bp%28L%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="&#92;frac{p(x)}{p(L)}" class="latex" /> is therefore telling us the probability that we took path <img src="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=x&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="x" class="latex" /> given that we saw <img src="https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="L" class="latex" />, <img src="https://s0.wp.com/latex.php?latex=P%28x+%7C+L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=P%28x+%7C+L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=P%28x+%7C+L%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="P(x | L)" class="latex" />.</p>
<p>Now consider <em>all possible</em> log outputs produced by the placement <img src="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="S" class="latex" />. We can measure the entropy of the placement, <img src="https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="H_S" class="latex" /> as <img src="https://s0.wp.com/latex.php?latex=H_%7BS%7D%28X%29+%3D+%5Csum_%7BL+%5Cin+O%28S%29%7D+p%28L%29H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=H_%7BS%7D%28X%29+%3D+%5Csum_%7BL+%5Cin+O%28S%29%7D+p%28L%29H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=H_%7BS%7D%28X%29+%3D+%5Csum_%7BL+%5Cin+O%28S%29%7D+p%28L%29H_L&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="H_{S}(X) = &#92;sum_{L &#92;in O(S)} p(L)H_L" class="latex" />, where <img src="https://s0.wp.com/latex.php?latex=O%28S%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=O%28S%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=O%28S%29&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="O(S)" class="latex" /> is the set of all possible log sequences under placement <img src="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="S" class="latex" />. This reduces to:<br />
<img src="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BS%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L_x%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BS%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L_x%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+H_%7BS%7D%28X%29+%3D+-+%5Csum_%7Bx+%5Cin+X%7D+p%28x%29+%5Clog_2+%5Cfrac%7Bp%28x%29%7D%7Bp%28L_x%29%7D&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="&#92;displaystyle H_{S}(X) = - &#92;sum_{x &#92;in X} p(x) &#92;log_2 &#92;frac{p(x)}{p(L_x)}" class="latex" /></p>
<h3>What’s the overhead of a log statement?</h3>
<p>If we assume a fixed cost each time we emit a log statement, then the cost of given log statement placement is directly proportional to the number of times we expect it to be executed. We can figure this out from the production sampling, and assign each placement a weight <img src="https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="w" class="latex" /> representing that cost.</p>
<h3>The Log20 placement algorithm</h3>
<blockquote><p>
Given a set of basic blocks, BB, where each block has a weight, <img src="https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=w&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="w" class="latex" />, the problem of placement is to find a subset of BB, <img src="https://s0.wp.com/latex.php?latex=S++%5Csubset+BB&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=S++%5Csubset+BB&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=S++%5Csubset+BB&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="S &#92;subset BB" class="latex" />, such that the sum of the weights of all basic blocks in <img src="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="S" class="latex" /> is under a threshold, <img src="https://s0.wp.com/latex.php?latex=W_T&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=W_T&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=W_T&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="W_T" class="latex" />, and entropy <img src="https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=H_S&#038;bg=eeeeee&#038;fg=666666&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="H_S" class="latex" /> is minimized.
</p></blockquote>
<p>A brute force search is O(2^N), where N is the number of basic blocks, so that’s not going to work! Instead Log20 uses a greedy approximation algorithm. Sort the basic blocks in ascending order of weight (i.e., cheapest to instrument first). Considering them in this order, add them to the current placement if and only if adding the block under consideration both reduces the entropy and causes us to remain under the weight threshold.</p>
<p>One nice consequence of this is that all of the very rarely executed (and hence likely to be buggy) code paths tend to get instrumented.</p>
<p>Considering the example program we looked at earlier, with a weight threshold of 1.00 (on average there should be no more than 1.00 log entries printed by an execution path), then a single LPS should be placed at line 3 giving entropy 2.67. With a budget of 2.00, logging should be placed at lines 3 and 7.</p>
<p>Section 4.3 in the paper details an extension to the scheme I have just described which considers also logging variable values in LPSes. When these disambiguate later execution paths, logging such a value can reduce the number of downstream log statements required.</p>
<h3>Implementation details</h3>
<p>Log20 comprises an instrumentation library, a tracing library used for both request tracing and logging, and an LPS placement generator using the algorithm we just examined. The instrumentation library uses Soot for bytecode instrumentation.</p>
<p>The tracing library has low overhead and consists of a scheduler and multiple logging containers (one per thread), each with a 4MB memory buffer. Log entries are of the form <code>timestamp MethodID#BBID, threadID</code> plus any variable values. In the evaluation, each logging invocation takes 43ns on average, compared to 1.5 microseconds for Log4j.</p>
<p>If you’re feeling brave, you can even have Log20 dynamically adjust the placement of log statements at runtime based on continued sampling of traces.</p>
<h3>Evaluation</h3>
<p>The following charts show the relationship between overhead and entropy when using Log20 with HDFS, HBase, Hadoop YARN, and ZooKeeper. You can also see where the current manual instrumentation sits.</p>
<p><img src="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-fig-4.jpeg?w=640" alt="" /></p>
<blockquote><p>
In HDFS, Log20’s placement can reduce the entropy from 6.41 to 0.91 with fewer than two log entries per request. Intuitively, this means that with two log entries per request, Log20 can reduce the number of possible paths from 2^6.41 (85) to 2^0.91 (2)&#8230; Log20 is substantially more efficient in disambiguating code paths compared to the existing placements.
</p></blockquote>
<p>For the same information level as existing <code>Info</code> logs, Log20 needs only 0.08 entries per request, versus 1.58 in the current system. If we consider <code>Debug</code>, Log20 needs just 0.32 log entries per request to achieve the same entropy as HDFS current 2434.92 log entries per request!</p>
<p>The real-world usefulness of Log20 for debugging was evaluated by looking at 41 randomly selected user-reported HDFS failures. Log20 was configured to hit the same performance threshold as the existing logs. Log20’s output is helpful in debugging 28 out of the 41. The existing log instrumentation helps in debugging 27.</p>
<p><img src="https://blog.acolyer.org/wp-content/uploads/2017/10/log20-fig-7.jpeg?w=480" alt="" /></p>
<p>After all that work, it’s a little disappointing that for the same performance cost, Log20 doesn’t do much better overall. However, when we zoom into cold or rarely executed paths (see B) above, Log20 does indeed give much better coverage.</p>
<blockquote><p>
Guided by information theory, [Log20] measures how effective each logging statement is in disambiguating code paths. We have shown that the placement strategy inferred by Log20 is significantly more efficient in path disambiguation than the placement of log printing statements in existing programs.
</p></blockquote>
<div id="jp-post-flair" class="sharedaddy sd-like-enabled sd-sharing-enabled"><div class="sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing"><h3 class="sd-title">Share this:</h3><div class="sd-content"><ul><li class="share-twitter"><a rel="nofollow noopener noreferrer"
data-shared="sharing-twitter-5994"
class="share-twitter sd-button share-icon"
href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/?share=twitter"
target="_blank"
aria-labelledby="sharing-twitter-5994"
>
<span id="sharing-twitter-5994" hidden>Share on X (Opens in new window)</span>
<span>X</span>
</a></li><li class="share-linkedin"><a rel="nofollow noopener noreferrer"
data-shared="sharing-linkedin-5994"
class="share-linkedin sd-button share-icon"
href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/?share=linkedin"
target="_blank"
aria-labelledby="sharing-linkedin-5994"
>
<span id="sharing-linkedin-5994" hidden>Share on LinkedIn (Opens in new window)</span>
<span>LinkedIn</span>
</a></li><li class="share-email"><a rel="nofollow noopener noreferrer"
data-shared="sharing-email-5994"
class="share-email sd-button share-icon"
href="mailto:?subject=%5BShared%20Post%5D%20Log20%3A%20Fully%20automated%20optimal%20placement%20of%20log%20printing%20statements%20under%20specified%20overhead%20threshold&#038;body=https%3A%2F%2Fblog.acolyer.org%2F2017%2F11%2F03%2Flog20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold%2F&#038;share=email"
target="_blank"
aria-labelledby="sharing-email-5994"
data-email-share-error-title="Do you have email set up?" data-email-share-error-text="If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself." data-email-share-nonce="ce59518c52" data-email-share-track-url="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/?share=email">
<span id="sharing-email-5994" hidden>Email a link to a friend (Opens in new window)</span>
<span>Email</span>
</a></li><li class="share-print"><a rel="nofollow noopener noreferrer"
data-shared="sharing-print-5994"
class="share-print sd-button share-icon"
href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#print?share=print"
target="_blank"
aria-labelledby="sharing-print-5994"
>
<span id="sharing-print-5994" hidden>Print (Opens in new window)</span>
<span>Print</span>
</a></li><li class="share-end"></li></ul></div></div></div><div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-23592848-5994-6aa371fb4537a' data-src='//widgets.wp.com/likes/index.html?ver=20260911#blog_id=23592848&amp;post_id=5994&amp;origin=adriancolyer.wordpress.com&amp;obj_id=23592848-5994-6aa371fb4537a&amp;domain=blog.acolyer.org' data-name='like-post-frame-23592848-5994-6aa371fb4537a' data-title='Like or Reblog'><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height: 55px;'><span class='button'><span>Like</span></span> <span class='loading'>Loading...</span></div><span class='sd-text-color'></span><a class='sd-link-color'></a></div>
<div id='jp-relatedposts' class='jp-relatedposts' >
<h3 class="jp-relatedposts-headline"><em>Related</em></h3>
</div></div> </div><!-- .entry-content -->
<footer class="entry-footer">
<span class="cat-links">
Posted in <a href="https://blog.acolyer.org/category/uncategorized/" rel="category tag">Uncategorized</a> </span>
<span class="tags-links">
<a href="https://blog.acolyer.org/tag/operations/" rel="tag">Operations</a> </span>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
<nav class="navigation post-navigation" aria-label="Posts">
<h2 class="screen-reader-text">Post navigation</h2>
<div class="nav-links"><div class="nav-previous"><a href="https://blog.acolyer.org/2017/11/02/my-vm-is-lighter-and-safer-than-your-container/" rel="prev"><span class="meta-nav">&lsaquo; Previous</span>My VM is lighter (and safer) than your&nbsp;container</a></div><div class="nav-next"><a href="https://blog.acolyer.org/2017/11/06/statistically-rigorous-java-performance-evaluation/" rel="next"><span class="meta-nav">Next &rsaquo;</span>Statistically rigorous Java performance&nbsp;evaluation</a></div></div>
</nav>
<div id="comments" class="comments-area">
<h2 class="comments-title">
15 thoughts on &ldquo;<span>Log20: Fully automated optimal placement of log printing statements under specified overhead&nbsp;threshold</span>&rdquo; </h2><!-- .comments-title -->
<ol class="comment-list">
<li id="comment-17648" class="comment even thread-even depth-1 parent">
<article id="div-comment-17648" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Piotr&#039;s avatar' src='https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=60&#038;d=identicon&#038;r=G' srcset='https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=60&#038;d=identicon&#038;r=G 1x, https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=90&#038;d=identicon&#038;r=G 1.5x, https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=120&#038;d=identicon&#038;r=G 2x, https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=180&#038;d=identicon&#038;r=G 3x, https://0.gravatar.com/avatar/c6ca5a653873c23559f99dc3fc3bd5f27f8f290147f8bb70f633dfa97ee6548d?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' decoding='async' /> <b class="fn">Piotr</b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17648"><time datetime="2017-11-03T16:36:19+00:00">November 3, 2017 at 4:36 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Great stuff. I could follow almost the whole post but got stuck at the end. Whats with this &#8220;LPSes on cold paths and LPSes on rare paths&#8221; on the last figure? These appear to only be numbers for Log20. Where are the numbers for manual logging? Also, how does it prove that &#8220;Log20 does indeed give much better coverage&#8221;? Isn&#8217;t the coverage shown to be almost the same by Fig 7A?</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-17924" class="comment byuser comment-author-nuklly odd alt depth-2">
<article id="div-comment-17924" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='xzhao&#039;s avatar' src='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' decoding='async' /> <b class="fn"><a href="http://nuklly.wordpress.com" class="url" rel="ugc external nofollow">xzhao</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17924"><time datetime="2017-11-10T11:18:53+00:00">November 10, 2017 at 11:18 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Hello, we are the authors of Log20. We appreciate your comments!<br />
On the last figure, “LPSes on the cold path” means Log20 places log printing statements on the paths that are not covered by our runtime trace. And “LPSes on the rare path” means Log20 places log printing statements on the paths that exist in the runtime trace but are rarely executed since they are the error paths. For manual logging, there are 20 debuggable cases on the cold path and 12 cases on the rare path, where we use the same definition of “cold” and “rare” path as in Log20. Although Log20 only beats manual logging marginally, Log20 is a fully automated approach, while manual logging is achieved after a long history of revisions.<br />
We are currently packaging a release version of our code. We should be able to respond to your email in the next few days!</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
<li id="comment-17653" class="comment even thread-odd thread-alt depth-1">
<article id="div-comment-17653" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Shridhar V&#039;s avatar' src='https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=60&#038;d=identicon&#038;r=G' srcset='https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=60&#038;d=identicon&#038;r=G 1x, https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=90&#038;d=identicon&#038;r=G 1.5x, https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=120&#038;d=identicon&#038;r=G 2x, https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=180&#038;d=identicon&#038;r=G 3x, https://0.gravatar.com/avatar/f5ee555fcbfecbb5823f14868219424c0b145a71b0cd68888939fa1cec97f58e?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' decoding='async' /> <b class="fn">Shridhar V</b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17653"><time datetime="2017-11-03T23:30:07+00:00">November 3, 2017 at 11:30 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Very interesting !</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
<li id="comment-17694" class="comment odd alt thread-even depth-1">
<article id="div-comment-17694" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Alex Melville&#039;s avatar' src='https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39' srcset='https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39 1x, https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39 1.5x, https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39 2x, https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39 3x, https://graph.facebook.com/v2.9/10155984244730087/picture?type=large&#038;_md5=588e1057a000b83a0db647840a015b39 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="https://www.facebook.com/app_scoped_user_id/10155984244730087/" class="url" rel="ugc external nofollow">Alex Melville</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17694"><time datetime="2017-11-05T16:47:25+00:00">November 5, 2017 at 4:47 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Where can we get the source code for this? I&#8217;d like to try to run this on a Java project of ours. Thanks for the great synopsis!</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
<li id="comment-17705" class="pingback even thread-odd thread-alt depth-1">
<div class="comment-body">
Pingback: <a href="http://sreweekly.com/sre-weekly-issue-96/" class="url" rel="ugc external nofollow">SRE Weekly Issue #96 &#8211; SRE WEEKLY</a> </div>
</li><!-- #comment-## -->
<li id="comment-17838" class="comment byuser comment-author-mondofree odd alt thread-even depth-1 parent">
<article id="div-comment-17838" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Vincenzo Ferme&#039;s avatar' src='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://mondolibero.wordpress.com/" class="url" rel="ugc external nofollow">Vincenzo Ferme</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17838"><time datetime="2017-11-08T13:35:34+00:00">November 8, 2017 at 1:35 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>I join the source code request from Alex Melville.</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-17877" class="comment byuser comment-author-adriancolyer bypostauthor even depth-2 parent">
<article id="div-comment-17877" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='adriancolyer&#039;s avatar' src='https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=60&#038;d=identicon&#038;r=G' srcset='https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=60&#038;d=identicon&#038;r=G 1x, https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=90&#038;d=identicon&#038;r=G 1.5x, https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=120&#038;d=identicon&#038;r=G 2x, https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=180&#038;d=identicon&#038;r=G 3x, https://0.gravatar.com/avatar/3a354cf7a8268ff825f87b3c13e24831e4d773c637ee1a81895ed8e861fa8f1d?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="https://adriancolyer.wordpress.com" class="url" rel="ugc external nofollow">adriancolyer</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17877"><time datetime="2017-11-09T07:08:57+00:00">November 9, 2017 at 7:08 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>I couldn’t find any reference to source code in the paper or on the eecg site sadly (nor Google or GitHub of course!). But it might be worth emailing the paper authors directly to see if it’s available somewhere.</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-17878" class="comment byuser comment-author-mondofree odd alt depth-3">
<article id="div-comment-17878" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Vincenzo Ferme&#039;s avatar' src='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://mondolibero.wordpress.com/" class="url" rel="ugc external nofollow">Vincenzo Ferme</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17878"><time datetime="2017-11-09T07:23:23+00:00">November 9, 2017 at 7:23 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Just sent an email. I will share the answer here.</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
<li id="comment-17923" class="comment byuser comment-author-nuklly even depth-2 parent">
<article id="div-comment-17923" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='xzhao&#039;s avatar' src='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://nuklly.wordpress.com" class="url" rel="ugc external nofollow">xzhao</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17923"><time datetime="2017-11-10T11:18:07+00:00">November 10, 2017 at 11:18 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>We are currently packaging a release version of our code. We should be able to respond to your email in the next few days:)</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-17974" class="comment byuser comment-author-mondofree odd alt depth-3">
<article id="div-comment-17974" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Vincenzo Ferme&#039;s avatar' src='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/1402446b90dc852a67adba288229fca986423f0fba07827c56e6f40a062f393a?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://mondolibero.wordpress.com/" class="url" rel="ugc external nofollow">Vincenzo Ferme</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-17974"><time datetime="2017-11-11T18:09:12+00:00">November 11, 2017 at 6:09 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>This is great to know. Thanks!</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
<li id="comment-17965" class="pingback even thread-odd thread-alt depth-1">
<div class="comment-body">
Pingback: <a href="http://a1a.in/log20-fully-automatic-optimum-placement-of-log-printing-statements-under-specified-overhead-threshold/" class="url" rel="ugc external nofollow">Log20: Fully automatic optimum placement of log printing statements under specified overhead threshold | A1A</a> </div>
</li><!-- #comment-## -->
<li id="comment-21718" class="comment odd alt thread-even depth-1 parent">
<article id="div-comment-21718" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='Kunal Kapoor&#039;s avatar' src='https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf' srcset='https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf 1x, https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf 1.5x, https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf 2x, https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf 3x, https://graph.facebook.com/v2.9/10156218805254758/picture?type=large&#038;_md5=6ccab731e952694240b1e788207b78cf 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="https://www.facebook.com/app_scoped_user_id/10156218805254758/" class="url" rel="ugc external nofollow">Kunal Kapoor</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-21718"><time datetime="2018-03-01T21:44:37+00:00">March 1, 2018 at 9:44 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Very interesting paper. I&#8217;d be very excited to try the placement generator on our services and compare the outputs against what we have in production. Is there any initial release that can be tried out yet?</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-21771" class="comment byuser comment-author-nuklly even depth-2">
<article id="div-comment-21771" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='xzhao&#039;s avatar' src='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://gravatar.com/nuklly" class="url" rel="ugc external nofollow">xzhao</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-21771"><time datetime="2018-03-03T17:54:42+00:00">March 3, 2018 at 5:54 pm</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Hello Kunal, thank you for being interested in our work! We have prepared a release version of Log20. Please feel free to contact me by email (i@xuzhao.net) to get it. Thanks again!</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
<li id="comment-60698" class="comment odd alt thread-odd thread-alt depth-1 parent">
<article id="div-comment-60698" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='florence.fu&#039;s avatar' src='https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/43f1e96696ec17d96a1aa65cdf8b6191081c2dad87ad6327d6ef8d4537b60f65?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn">florence.fu</b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-60698"><time datetime="2019-08-01T10:39:53+01:00">August 1, 2019 at 10:39 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>why when weight threshold is 1.00 , then a single LPS should be placed at line 3 giving entropy 2.67.<br />
when X={3}, why Hs(X) = 2.67? p(3) = ?, p(L3)= ?</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
<ol class="children">
<li id="comment-72672" class="comment byuser comment-author-nuklly even depth-2">
<article id="div-comment-72672" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img referrerpolicy="no-referrer" alt='xzhao&#039;s avatar' src='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G' srcset='https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=60&#038;d=identicon&#038;r=G 1x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=90&#038;d=identicon&#038;r=G 1.5x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=120&#038;d=identicon&#038;r=G 2x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=180&#038;d=identicon&#038;r=G 3x, https://1.gravatar.com/avatar/a37bfa101fb97ea6540afd672ef729acd0299a512aa4d31e7b95026aab1c1ecf?s=240&#038;d=identicon&#038;r=G 4x' class='avatar avatar-60' height='60' width='60' loading='lazy' decoding='async' /> <b class="fn"><a href="http://nuklly.wordpress.com" class="url" rel="ugc external nofollow">xzhao</a></b> <span class="says">says:</span> </div><!-- .comment-author -->
<div class="comment-metadata">
<a href="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/#comment-72672"><time datetime="2019-09-06T11:10:34+01:00">September 6, 2019 at 11:10 am</time></a> </div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content">
<p>Placing a single LPS at line 3 devides all the paths into two disjoint partitions: {P1} (probab. 1/9) and {P2-P9} (probab. 8/9). Remember the probability is in terms of paths when calculating the entropy Hs.</p>
<p>So Hs{3} = -p({P1}) * p({P1})/p({P1})*log2(p({P1})/p({P1}))-Sigma_{i=2 to 9}^p({P2-P9}) * p({Pi})/p({P2-P9})*log2(p{Pi}/p{P2-P9}), p({Pi}) = 1/9, p({P2-P9}) = 8/9.</p>
<p>After the calculation, Hs{3} = 8/9 * 3 = 2.67.</p>
</div><!-- .comment-content -->
</article><!-- .comment-body -->
</li><!-- #comment-## -->
</ol><!-- .children -->
</li><!-- #comment-## -->
</ol><!-- .comment-list -->
<p class="no-comments">Comments are closed.</p>
</div><!-- #comments -->
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- #content -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info-wrapper clear">
<div class="site-info">
<a href="https://wordpress.com/?ref=footer_blog" rel="nofollow">Blog at WordPress.com.</a>
</div><!-- .site-info -->
</div><!-- .site-info-wrapper -->
</footer><!-- #colophon -->
</div><!-- #page -->
<!-- -->
<script type="speculationrules">
{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/files/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/pub/penscratch-2/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}
</script>
<script id="grofiles-cards-js" src="//0.gravatar.com/js/hovercards/hovercards.min.js?ver=202637d1133547e8a1f2801609f51cef12522abe7f6647d869e9fbc974fe356a37e613"></script>
<script id="wpgroho-js-extra">
var WPGroHo = {"my_hash":""};
//# sourceURL=wpgroho-js-extra
</script>
<script crossorigin='anonymous' type='text/javascript' src='/wp-content/mu-plugins/gravatar-hovercards/wpgroho.js?m=1610363240i'></script>
<script>
// Initialize and attach hovercards to all gravatars
( function() {
function init() {
if ( typeof Gravatar === 'undefined' ) {
return;
}
if ( typeof Gravatar.init !== 'function' ) {
return;
}
Gravatar.profile_cb = function ( hash, id ) {
WPGroHo.syncProfileData( hash, id );
};
Gravatar.my_hash = WPGroHo.my_hash;
Gravatar.init(
'body',
'#wp-admin-bar-my-account',
{
i18n: {
'Edit your profile →': 'Edit your profile →',
'View profile →': 'View profile →',
'Contact': 'Contact',
'Send money': 'Send money',
'Sorry, we are unable to load this Gravatar profile.': 'Sorry, we are unable to load this Gravatar profile.',
'Gravatar not found.': 'Gravatar not found.',
'Too Many Requests.': 'Too Many Requests.',
'Internal Server Error.': 'Internal Server Error.',
'Is this you?': 'Is this you?',
'Claim your free profile.': 'Claim your free profile.',
'Email': 'Email',
'Home Phone': 'Home Phone',
'Work Phone': 'Work Phone',
'Cell Phone': 'Cell Phone',
'Contact Form': 'Contact Form',
'Calendar': 'Calendar',
},
}
);
}
if ( document.readyState !== 'loading' ) {
init();
} else {
document.addEventListener( 'DOMContentLoaded', init );
}
} )();
</script>
<div style="display:none">
<div class="grofile-hash-map-1de9a5699a8417d70e8c3716f6fa196d">
</div>
<div class="grofile-hash-map-5f326d0832fee23401398d13a60f99bc">
</div>
<div class="grofile-hash-map-1e77170f9f181c2c933010bd7aecc247">
</div>
<div class="grofile-hash-map-dd2b33e5871e28a6fa7cb51bc66d00dc">
</div>
<div class="grofile-hash-map-1d518eeb871eb1e2e2721f53f9c53ed4">
</div>
<div class="grofile-hash-map-a795b4f89a6d096f314fc0a2c80479c1">
</div>
<div class="grofile-hash-map-0e06fa633e04a9f3deb22c19a98821ad">
</div>
<div class="grofile-hash-map-6d6e859edc32bf441cf4816c5f434545">
</div>
</div>
<div id="actionbar" dir="ltr" style="display: none;"
class="actnbr-pub-penscratch-2 actnbr-has-follow actnbr-has-actions">
<ul>
<li class="actnbr-btn actnbr-hidden">
<a class="actnbr-action actnbr-actn-reblog" href="">
<svg class="gridicon gridicons-reblog" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M22.086 9.914L20 7.828V18c0 1.105-.895 2-2 2h-7v-2h7V7.828l-2.086 2.086L14.5 8.5 19 4l4.5 4.5-1.414 1.414zM6 16.172V6h7V4H6c-1.105 0-2 .895-2 2v10.172l-2.086-2.086L.5 15.5 5 20l4.5-4.5-1.414-1.414L6 16.172z"/></g></svg><span>Reblog</span>
</a>
</li>
<li class="actnbr-btn actnbr-hidden">
<a class="actnbr-action actnbr-actn-follow " href="">
<svg class="gridicon" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path clip-rule="evenodd" d="m4 4.5h12v6.5h1.5v-6.5-1.5h-1.5-12-1.5v1.5 10.5c0 1.1046.89543 2 2 2h7v-1.5h-7c-.27614 0-.5-.2239-.5-.5zm10.5 2h-9v1.5h9zm-5 3h-4v1.5h4zm3.5 1.5h-1v1h1zm-1-1.5h-1.5v1.5 1 1.5h1.5 1 1.5v-1.5-1-1.5h-1.5zm-2.5 2.5h-4v1.5h4zm6.5 1.25h1.5v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25z" fill-rule="evenodd"></path></svg>
<span>Subscribe</span>
</a>
<a class="actnbr-action actnbr-actn-following no-display" href="">
<svg class="gridicon" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 4.5H4V15C4 15.2761 4.22386 15.5 4.5 15.5H11.5V17H4.5C3.39543 17 2.5 16.1046 2.5 15V3H17.5V12.5H16V4.5ZM5.5 6.5H14.5V8H5.5V6.5ZM5.5 9.5H9.5V11H5.5V9.5ZM12 11H13V12H12V11ZM10.5 9.5H14.5V13.5H10.5V9.5ZM5.5 12H9.5V13.5H5.5V12Z" fill="#008A20"></path><path d="M19.5303 15.0303L15.5 19.0605L12.9697 16.5303L14.0303 15.4697L15.5 16.9395L18.4697 13.9697L19.5303 15.0303Z" fill="#008A20"></path></svg>
<span>Subscribed</span>
</a>
<div class="actnbr-popover tip tip-top-left actnbr-notice" id="follow-bubble">
<div class="tip-arrow"></div>
<div class="tip-inner actnbr-follow-bubble">
<ul>
<li class="actnbr-sitename">
<a href="https://blog.acolyer.org">
<img loading='lazy' alt='' src='https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=50&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png' srcset='https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=50&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 1x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=75&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 1.5x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=100&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 2x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=150&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 3x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=200&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 4x' class='avatar avatar-50' height='50' width='50' /> the morning paper </a>
</li>
<div class="actnbr-message no-display"></div>
<form method="post" action="https://subscribe.wordpress.com" accept-charset="utf-8" style="display: none;">
<div class="actnbr-follow-count">Join 3,125 other subscribers</div>
<div>
<input type="email" name="email" placeholder="Enter your email address" class="actnbr-email-field" aria-label="Enter your email address" />
</div>
<input type="hidden" name="action" value="subscribe" />
<input type="hidden" name="blog_id" value="23592848" />
<input type="hidden" name="source" value="https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/" />
<input type="hidden" name="sub-type" value="actionbar-follow" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="030732bedd" /> <div class="actnbr-button-wrap">
<button type="submit" value="Sign me up">
Sign me up </button>
</div>
</form>
<li class="actnbr-login-nudge">
<div>
Already have a WordPress.com account? <a href="https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fblog.acolyer.org%252F2017%252F11%252F03%252Flog20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold%252F">Log in now.</a> </div>
</li>
</ul>
</div>
</div>
</li>
<li class="actnbr-ellipsis actnbr-hidden">
<svg class="gridicon gridicons-ellipsis" height="24" width="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M7 12c0 1.104-.896 2-2 2s-2-.896-2-2 .896-2 2-2 2 .896 2 2zm12-2c-1.104 0-2 .896-2 2s.896 2 2 2 2-.896 2-2-.896-2-2-2zm-7 0c-1.104 0-2 .896-2 2s.896 2 2 2 2-.896 2-2-.896-2-2-2z"/></g></svg> <div class="actnbr-popover tip tip-top-left actnbr-more">
<div class="tip-arrow"></div>
<div class="tip-inner">
<ul>
<li class="actnbr-sitename">
<a href="https://blog.acolyer.org">
<img loading='lazy' alt='' src='https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=50&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png' srcset='https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=50&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 1x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=75&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 1.5x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=100&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 2x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=150&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 3x, https://secure.gravatar.com/blavatar/a223d8685ecce4add34c037c09fa17d665b0daa6c6dc734f5984f129f7c5c2f8?s=200&#038;d=https%3A%2F%2Fs2.wp.com%2Fi%2Flogo%2Fwpcom-gray-white.png 4x' class='avatar avatar-50' height='50' width='50' /> the morning paper </a>
</li>
<li class="actnbr-folded-follow">
<a class="actnbr-action actnbr-actn-follow " href="">
<svg class="gridicon" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path clip-rule="evenodd" d="m4 4.5h12v6.5h1.5v-6.5-1.5h-1.5-12-1.5v1.5 10.5c0 1.1046.89543 2 2 2h7v-1.5h-7c-.27614 0-.5-.2239-.5-.5zm10.5 2h-9v1.5h9zm-5 3h-4v1.5h4zm3.5 1.5h-1v1h1zm-1-1.5h-1.5v1.5 1 1.5h1.5 1 1.5v-1.5-1-1.5h-1.5zm-2.5 2.5h-4v1.5h4zm6.5 1.25h1.5v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25z" fill-rule="evenodd"></path></svg>
<span>Subscribe</span>
</a>
<a class="actnbr-action actnbr-actn-following no-display" href="">
<svg class="gridicon" height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 4.5H4V15C4 15.2761 4.22386 15.5 4.5 15.5H11.5V17H4.5C3.39543 17 2.5 16.1046 2.5 15V3H17.5V12.5H16V4.5ZM5.5 6.5H14.5V8H5.5V6.5ZM5.5 9.5H9.5V11H5.5V9.5ZM12 11H13V12H12V11ZM10.5 9.5H14.5V13.5H10.5V9.5ZM5.5 12H9.5V13.5H5.5V12Z" fill="#008A20"></path><path d="M19.5303 15.0303L15.5 19.0605L12.9697 16.5303L14.0303 15.4697L15.5 16.9395L18.4697 13.9697L19.5303 15.0303Z" fill="#008A20"></path></svg>
<span>Subscribed</span>
</a>
</li>
<li class="actnbr-signup"><a href="https://wordpress.com/start/">Sign up</a></li>
<li class="actnbr-login"><a href="https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fblog.acolyer.org%252F2017%252F11%252F03%252Flog20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold%252F">Log in</a></li>
<li class="actnbr-shortlink">
<a href="https://wp.me/p1AZzO-1yG">
<span class="actnbr-shortlink__text">Copy shortlink</span>
<span class="actnbr-shortlink__icon"><svg class="gridicon gridicons-checkmark" height="16" width="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414"/></g></svg></span>
</a>
</li>
<li class="flb-report">
<a href="https://wordpress.com/abuse/?report_url=https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/" target="_blank" rel="noopener noreferrer">
Report this content </a>
</li>
<li class="actnbr-reader">
<a href="https://wordpress.com/reader/blogs/23592848/posts/5994">
View post in Reader </a>
</li>
<li class="actnbr-subs">
<a href="https://subscribe.wordpress.com/">Manage subscriptions</a>
</li>
<li class="actnbr-fold"><a href="">Collapse this bar</a></li>
</ul>
</div>
</div>
</li>
</ul>
</div>
<script>
window.addEventListener( "DOMContentLoaded", function( event ) {
var link = document.createElement( "link" );
link.href = "/wp-content/mu-plugins/actionbar/actionbar.css?v=20250116";
link.type = "text/css";
link.rel = "stylesheet";
document.head.appendChild( link );
var script = document.createElement( "script" );
script.src = "/wp-content/mu-plugins/actionbar/actionbar.js?v=20250204";
document.body.appendChild( script );
} );
</script>
<script type="text/javascript">
window.WPCOM_sharing_counts = {"https://blog.acolyer.org/2017/11/03/log20-fully-automated-optimal-placement-of-log-printing-statements-under-specified-overhead-threshold/":5994};
</script>
<script type="text/javascript">
(function () {
var wpcom_reblog = {
source: 'toolbar',
toggle_reblog_box_flair: function (obj_id, post_id) {
// Go to site selector. This will redirect to their blog if they only have one.
const postEndpoint = `https://wordpress.com/post`;
// Ideally we would use the permalink here, but fortunately this will be replaced with the
// post permalink in the editor.
const originalURL = `${ document.location.href }?page_id=${ post_id }`;
const url =
postEndpoint +
'?url=' +
encodeURIComponent( originalURL ) +
'&is_post_share=true' +
'&v=5';
const redirect = function () {
if (
! window.open( url, '_blank' )
) {
location.href = url;
}
};
if ( /Firefox/.test( navigator.userAgent ) ) {
setTimeout( redirect, 0 );
} else {
redirect();
}
},
};
window.wpcom_reblog = wpcom_reblog;
})();
</script>
<script id="sharing-js-js-extra">
var sharing_js_options = {"lang":"en","counts":"1","is_stats_active":"1"};
//# sourceURL=sharing-js-js-extra
</script>
<script crossorigin='anonymous' type='text/javascript' src='/_static/??-eJyVj0kOwjAQBD+EM4BEEg6IpyDHnsTjZWxim+X3LOIQccutS6o6NNyTUJELcoFQRfJ1Is7gyWGGa8WKRrL2ODc2b2AhF4PhraQ6QELOapZFGbEHm4HljSZZKPKKaMkrsuwoCU/sxBhVzWKkx3+9uGWxJKncjyHEyHAhVjBU8hqykTNqqfXzO4mnJtDnxDmcdl3fHQ/bvm3tC5SKcX4='></script>
<script id="sharing-js-js-after">
window.WPCOM_sharing_popups = window.WPCOM_sharing_popups || {};
window.WPCOM_sharing_popups[ "twitter" ] = "menubar=1,resizable=1,width=600,height=350";
window.WPCOM_sharing_popups = window.WPCOM_sharing_popups || {};
window.WPCOM_sharing_popups[ "linkedin" ] = "menubar=1,resizable=1,width=580,height=450";
//# sourceURL=sharing-js-js-after
</script>
<script id="wp-emoji-settings" type="application/json">
{"baseUrl":"https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/","ext":".png","svgUrl":"https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/","svgExt":".svg","source":{"concatemoji":"/wp-includes/js/wp-emoji-release.min.js?m=1783090810i&ver=7.1.1-alpha-63555"}}
</script>
<script type="module">
/*! This file is auto-generated */
var e="script#wp-emoji-settings",t=document.querySelector(e);if(!(t instanceof HTMLScriptElement))throw new Error("Element missing: "+e);const r=JSON.parse(t.text),s=(window._wpemojiSettings=r,"wpEmojiSettingsSupports"),o=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(s,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const r=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===r[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,r){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!r(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,r){let a;const s=(a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),o=(s.textBaseline="top",s.font="600 32px Arial",{});return e.forEach(e=>{o[e]=t(s,e,n,r)}),o}function a(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}r.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(s));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(o),u.toString(),c.toString(),p.toString()].join(",")+"));",r=new Blob([e],{type:"text/javascript"});const a=new Worker(URL.createObjectURL(r),{name:"wpTestEmojiSupports"});return void(a.onmessage=e=>{i(n=e.data),a.terminate(),t(n)})}catch(e){}i(n=f(o,u,c,p))}t(n)}).then(e=>{for(const n in e)r.supports[n]=e[n],r.supports.everything=r.supports.everything&&r.supports[n],"flag"!==n&&(r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&r.supports[n]);var t;r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&!r.supports.flag,r.supports.everything||((t=r.source||{}).concatemoji?a(t.concatemoji):t.wpemoji&&t.twemoji&&(a(t.twemoji),a(t.wpemoji)))});
//# sourceURL=/wp-includes/js/wp-emoji-loader.min.js
</script>
<iframe src='https://widgets.wp.com/likes/master.html?ver=20260911#ver=20260911' scrolling='no' id='likes-master' name='likes-master' style='display:none;'></iframe>
<div id='likes-other-gravatars' role="dialog" aria-hidden="true" tabindex="-1"><div class="likes-text"><span>%d</span></div><ul class="wpl-avatars sd-like-gravatars"></ul></div>
<script src="//stats.wp.com/w.js?69" defer></script> <script type="text/javascript">
_tkq = window._tkq || [];
_stq = window._stq || [];
_tkq.push(['storeContext', {'blog_id':'23592848','blog_tz':'1','user_lang':'en','blog_lang':'en','user_id':'0'}]);
// Prevent sending pageview tracking from WP-Admin pages.
_stq.push(['view', {'blog':'23592848','v':'wpcom','tz':'1','user_id':'0','post':'5994','subd':'adriancolyer'}]);
_stq.push(['extra', {'crypt':'UE5tW3cvZGRDbzJxMWx6aVlydldVeXIvdUpWanJmOVg4Mys2XWxoN19+Lk5YJUp6QyVxQW02Q0lDM1lFMHBvZkEwd0d2V3RsSXgrdTJBMDZCRSw1UEJSOTBhW3prWF14am1FRmd6VkVHQ3F6LD9+ZjRwbVYmci5VR2MlWTVoajdudFg1bC16bUhUdD8lYXFCYVpiK19nNWhrRTlJYVAzU1lbUEIuMjldQzBGK1IuW01KV0VtPTRmW0VCN0xoa3lNPTdaOHdvXVtjU2YwRm5MM1d1bUpXLm1jOX4mPUtLRks='}]);
_stq.push([ 'clickTrackerInit', '23592848', '5994' ]);
</script>
<noscript><img src="https://pixel.wp.com/b.gif?v=noscript" style="height:1px;width:1px;overflow:hidden;position:absolute;bottom:1px;" alt="" /></noscript>
<meta id="bilmur" property="bilmur:data" content="" data-provider="wordpress.com" data-service="simple" data-site-tz="Europe/London" data-custom-props="{&quot;logged_in&quot;:&quot;0&quot;,&quot;wptheme&quot;:&quot;pub\/penscratch-2&quot;,&quot;wptheme_is_block&quot;:&quot;0&quot;}" >
<script defer src="/wp-content/js/bilmur.min.js?i=17&amp;m=202637"></script>
</body>
</html>