2019-06-26 03:14:38 +03:00
|
|
|
import log
|
|
|
|
|
2019-11-25 07:50:59 +03:00
|
|
|
fn main() {
|
2019-12-01 12:50:13 +03:00
|
|
|
mut l := log.Log{}
|
2020-04-06 18:22:53 +03:00
|
|
|
l.set_level(.info)
|
2019-12-01 12:50:13 +03:00
|
|
|
// Make a new file called info.log in the current folder
|
|
|
|
l.set_full_logpath('./info.log')
|
2021-02-23 20:43:44 +03:00
|
|
|
println('Please check the file: $l.output_file_name after this example crashes.')
|
2020-04-06 18:22:53 +03:00
|
|
|
|
2019-11-25 07:50:59 +03:00
|
|
|
l.info('info')
|
|
|
|
l.warn('warn')
|
|
|
|
l.error('error')
|
|
|
|
l.debug('no debug')
|
2020-04-06 18:22:53 +03:00
|
|
|
l.set_level(.debug)
|
2019-11-25 07:50:59 +03:00
|
|
|
l.debug('debug')
|
|
|
|
l.fatal('fatal')
|
2019-06-27 13:27:46 +03:00
|
|
|
}
|