| ... | @@ -142,6 +142,8 @@ fn log( | ... | @@ -142,6 +142,8 @@ fn log( |
| 142 | | 142 | |
| 143 | if (@enumToInt(message_level) <= @enumToInt(effective_log_level)) { | 143 | if (@enumToInt(message_level) <= @enumToInt(effective_log_level)) { |
| 144 | if (@hasDecl(root, "log")) { | 144 | if (@hasDecl(root, "log")) { |
| | 145 | if (@typeInfo(@TypeOf(root.log)) != .Fn) |
| | 146 | @compileError("Expected root.log to be a function"); |
| 145 | root.log(message_level, scope, format, args); | 147 | root.log(message_level, scope, format, args); |
| 146 | } else if (std.Target.current.os.tag == .freestanding) { | 148 | } else if (std.Target.current.os.tag == .freestanding) { |
| 147 | // On freestanding one must provide a log function; we do not have | 149 | // On freestanding one must provide a log function; we do not have |