fix crash if logger not defined
replace byline by lazy