improve statement logging