markused,builtin,strconv,vlib: reduce generated C sizes for compilers != tcc, for short programs, by simplifying the generation of backtraces, and reducing string interpolations in panics (#23380)

This commit is contained in:
Delyan Angelov 2025-01-06 08:23:56 +02:00 committed by GitHub
parent 738f847f89
commit e983d75b64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 278 additions and 191 deletions

View file

@ -72,7 +72,7 @@ pub fn (mut l Log) set_output_path(output_file_path string) {
l.output_target = .file
l.output_file_name = os.join_path(os.real_path(output_file_path), l.output_label)
ofile := os.open_append(l.output_file_name) or {
panic('error while opening log file ${l.output_file_name} for appending')
panic('error while opening log file ' + l.output_file_name + ' for appending')
}
l.ofile = ofile
}
@ -160,7 +160,7 @@ pub fn (mut l Log) fatal(s string) {
l.send_output(s, .fatal)
l.ofile.close()
}
panic('${l.output_label}: ${s}')
panic(l.output_label + ': ' + s)
}
// error logs line `s` via `send_output` if `Log.level` is greater than or equal to the `Level.error` category.