Logging and string formatting
Hello,
I am building with mojo and wondering if there is any logger module out there or we can only print for now. On the other side I would like to check which are the string formatting options to be able to print variables mixed with messages etc. I tried
.format()
but I get an error that 'StringLiteral' value has no attribute 'format'
2 Replies
re logging:
https://github.com/mojicians/awesome-mojo?tab=readme-ov-file#logging
re
StringLiteral
's attribs & methods:
https://docs.modular.com/mojo/stdlib/builtin/string_literal/StringLiteralYou need to explicitly convert the StringLiteral to a String then call format. This isn't going to be necessary in the future but not sure when.
My bad. String.format isn't actually a thing yet. Probably coming soon though based on some other recently added methods