logging js functionality