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:
18
vlib/v/tests/valgrind/logging.v
Normal file
18
vlib/v/tests/valgrind/logging.v
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user