1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

log: avoid using string__plus memory leak (#11128)

This commit is contained in:
wilesun
2021-08-11 14:26:02 +08:00
committed by GitHub
parent 70124d2d23
commit 18be9e52be
3 changed files with 24 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
import log
import time
fn main() {
mut l := log.Log{}
defer {
l.close()
}
l.set_level(.info)
l.info('info')
l.warn('warn')
l.error('an error')
l.debug('some debug info')
for i := 0; i < 100; i++ {
l.info('123456')
time.sleep(1 * time.millisecond)
}
}