Hi guys. I'd like to get rid of the terminal [for monitoring trace output] while developing AS3 projects. I'd like to use a command like: (code) :>/Users/{me}/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt #truncate the flashlog echo "<pre>" tail -f /Users/schell/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt & (/code) in order to have the contents of my flashlog.txt spill into the html output window. This would be great because I'd like to format my trace statements with HTML.
That won't update in real time, so I've written this code instead for testing: (code) cat<<-HTML <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>untitled</title> <script type="text/javascript" charset="utf-8"> function update() { var updateCommand = TextMate.system("tail -f /Users/schell/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt", endHandler); updateCommand.onreadoutput = outputHandler;
function endHandler(s) { }
function outputHandler(currentStringOnStdout) { // Code that does something with the command’s current output like... document.getElementById("flashlog").innerText = currentStringOnStdout; } } </script> </head> <body> <button onclick="update()">UPDATE</button><br>
<pre id="flashlog"> </pre>
</body> </html> HTML (/code)
But with this code I never get any output. If I replace my 'tail -f' with something like 'ping efnx.com', I get some output. Is this because we're not allowed to access any files through this interface? Anyone have any ideas? -- Schell Scivally efsubenovex@gmail.com http://blog.efnx.com
On 2 Oct 2009, at 02:13, Schell wrote:
[...] tail -f /Users/schell/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt & [...] That won't update in real time, so I've written this code instead for testing:
I made this simple command:
tail -f /tmp/test.log|pre
Set output to “Show as HTML” and it works fine.
I recently suffered a massive hd failure on my mac and am now on Ubuntu until my new drive comes. There's no man pages for 'pre' and its google results are convoluted at best - what does it do? I really hope it's as easy as that. Can you test and see if you can do this with a file in your home directory? Hopefully it's possible outside /tmp. It may be that in the same script I'm issuing commands to build my project and either the build commands or the 'tail -f' need to be done in the background. Thanks for your input.
On Sat, Oct 3, 2009 at 11:26 AM, Allan Odgaard mailinglist@textmate.org wrote:
On 2 Oct 2009, at 02:13, Schell wrote:
[...] tail -f /Users/schell/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt & [...] That won't update in real time, so I've written this code instead for testing:
I made this simple command:
tail -f /tmp/test.log|pre
Set output to “Show as HTML” and it works fine.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
From: textmate-bounces+dru=summitprojects.com@lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com@lists.macromates.com] On Behalf Of Schell Subject: [TxMt] Re: Using tail -f for HTML output
Can you test and see if you can do this with a file in your home directory? Hopefully it's possible outside /tmp.
I really don't know what pre does, but I tried Allan's suggestion, only pointing it at my flashlog.txt file, and it worked fine.
Personally, I just use Console for this, but it's good to know that we can do this.
Awesome, thanks guys.
On Thu, Oct 8, 2009 at 12:46 PM, Dru Kepple dru@summitprojects.com wrote:
From: textmate-bounces+dru=summitprojects.com@lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com@lists.macromates.com] On Behalf Of Schell Subject: [TxMt] Re: Using tail -f for HTML output
Can you test and see if you can do this with a file in your home directory? Hopefully it's possible outside /tmp.
I really don't know what pre does, but I tried Allan's suggestion, only pointing it at my flashlog.txt file, and it worked fine.
Personally, I just use Console for this, but it's good to know that we can do this.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Allan, any word on how piping to 'pre' works? Seems it's a TM only thing, and wraps the output in pre tags, but also double quotes each new line. I'd like to be able to trace out html to format my output and have tried piping to body, div, etc. What's available here?
On Fri, Oct 9, 2009 at 9:04 AM, Schell efsubenovex@gmail.com wrote:
Awesome, thanks guys.
On Thu, Oct 8, 2009 at 12:46 PM, Dru Kepple dru@summitprojects.com wrote:
From: textmate-bounces+dru=summitprojects.com@lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com@lists.macromates.com] On Behalf Of Schell Subject: [TxMt] Re: Using tail -f for HTML output
Can you test and see if you can do this with a file in your home directory? Hopefully it's possible outside /tmp.
I really don't know what pre does, but I tried Allan's suggestion, only pointing it at my flashlog.txt file, and it worked fine.
Personally, I just use Console for this, but it's good to know that we can do this.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
-- Schell Scivally efsubenovex@gmail.com http://blog.efnx.com
On 10 Oct 2009, at 00:46, Schell wrote:
Allan, any word on how piping to 'pre' works? […]
It’s a short bash function defined here: http://svn.textmate.org/trunk/Support/lib/bash_init.sh
# use this as a filter (|pre) when you want # raw output to show as such in the HTML output pre () { echo -n '<pre style="word-wrap: break-word;">' perl -pe '$| = 1; s/&/&/g; s/</</g; s/>/>/g; s/$\n/ <br>/' echo '</pre>' }
Ah, thanks!
On Sat, Oct 10, 2009 at 5:28 AM, Allan Odgaard mailinglist@textmate.org wrote:
On 10 Oct 2009, at 00:46, Schell wrote:
Allan, any word on how piping to 'pre' works? […]
It’s a short bash function defined here: http://svn.textmate.org/trunk/Support/lib/bash_init.sh
# use this as a filter (|pre) when you want # raw output to show as such in the HTML output pre () { echo -n '<pre style="word-wrap: break-word;">' perl -pe '$| = 1; s/&/&/g; s/</</g; s/>/>/g; s/$\n/ <br>/' echo '</pre>' }
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate