You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// the given logger instance could have a level to filter some levels used here
22
23
log.info('info')
23
24
log.warn('warn')
24
25
log.error('error')
25
26
log.debug('no output for debug')
26
-
// log.set_level(.debug) // not usable here because not part of Logger interface
27
+
log.set_level(.debug) // change logging level, now part of the Logger interface
28
+
log.debug('output for debug now')
29
+
log.info('output for info now')
27
30
println(@FN +' end')
28
31
}
29
32
30
33
fndelay() {
31
34
time.sleep(1* time.second)
32
35
}
33
36
37
+
// Note that Log and Logger methods requires a mutable instance
38
+
34
39
// new_log create and return a new Log reference
35
40
pub fnnew_log() &Log {
36
41
return&Log{
@@ -54,22 +59,6 @@ fn test_log_mutable() {
54
59
println(@FN +' end')
55
60
}
56
61
57
-
/*
58
-
// TODO: with Logger methods requiring a mutable instance, now I get a compilation error: `l` is immutable, declare it with `mut` to make it mutable ... check if it's good the same now and/or what to do ... wip
0 commit comments