Logging in Textadept #291
eric1234
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
That's a good tip. Why not use `io.open(..., 'a+'):write(msg, '\n'):close()`? There shouldn't be any concurrency issues.
For my part, I use `print()` statements (not `ui.print()`, but Lua's `print()`) and run Textadept from a terminal. (I'm on Linux.) Any printed messages are printed to stdout and show up in the terminal.
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been customizing my Textadept pretty heavily. Thankfully it is so customizable! But I haven't really figured out a way to debug well.
ui.statusbar_text
is decent but it only shows the most recent message.ui.print
can have a list of messages but it opens that up in a buffer which can interfere with what I am trying to debug. Probably any sort of interactive debugging would also only interfere with what I am trying to debug so some sort of logging seems best. Wrote the following quick function to help me do this:I assign this to
textadept.log
then use like this:Indicating the module helps filter the log messages but it is optional. All log messages have a date which helps. Spawning a process just to log a message isn't exactly the most efficient but it's the only way I could figure out how to do it via the API I had. Anyway just figured I would share in case it is helpful to anyone else trying to debug their code.
Beta Was this translation helpful? Give feedback.
All reactions