[ANN] Logtails 0.4 : the time saving release

B

Bauduin Raphael

Hi,

Logtails 0.4 has arrived ( http://rubyforge.org/frs/?group_id=500 ), and
it now contains all functionalities I need and wanted to put in. The
most important addition of this release is that it is now possible to
save sessions. When you save the session to a file (YAML format), you
can reopen it later and have all your tails and their respective tabs
restored, including the regexps you specified for the tabs. This is
really time saving! When you have tabs already open, and you restore a
session, the tabs saved in the session are added to the already existing
tabs.

Sessions don't save the output displayed though. But you can manually
save each tab's content to a (local) file.

The interface to open a remote tab is now the same as the one used for
local tails. You can even browse the remote filesystem to choose the
file to watch (all thanks to KDE's kio slaves).

There's also an indicator for when a tab's content has changed, and you
can insert blank line to the tail's output, just as you can when you
press enter in a terminal running tail -f.

Here's the changelog:

-Save and reload sessions
-Local and remote tails are started through the same interface
-Open a file by browsing the file system (local and remote)
-Insert blank lines in the active tab by pressing enter
-Insert a blank line in all tabs with CTRL+ENTER
-Save the tab's content to a file
-Tab label of remote files don't show the whole path
-Star prepended to the tab label when changes occur. Star removed when
tab is activited

The only things I plan to add are:
- splitting, so you can display several tails side by side
- fixes and cleanups

links:
summary page: http://rubyforge.org/projects/logtails/
download page: http://rubyforge.org/frs/?group_id=500

Raph
 
R

Richard Dale

Bauduin said:
Hi,

Logtails 0.4 has arrived ( http://rubyforge.org/frs/?group_id=500 ), and
it now contains all functionalities I need and wanted to put in. The
most important addition of this release is that it is now possible to
save sessions. When you save the session to a file (YAML format), you
can reopen it later and have all your tails and their respective tabs
restored, including the regexps you specified for the tabs. This is
really time saving! When you have tabs already open, and you restore a
session, the tabs saved in the session are added to the already existing
tabs.

Sessions don't save the output displayed though. But you can manually
save each tab's content to a (local) file.

The interface to open a remote tab is now the same as the one used for
local tails. You can even browse the remote filesystem to choose the
file to watch (all thanks to KDE's kio slaves).

There's also an indicator for when a tab's content has changed, and you
can insert blank line to the tail's output, just as you can when you
press enter in a terminal running tail -f.

Here's the changelog:

-Save and reload sessions
-Local and remote tails are started through the same interface
-Open a file by browsing the file system (local and remote)
-Insert blank lines in the active tab by pressing enter
-Insert a blank line in all tabs with CTRL+ENTER
-Save the tab's content to a file
-Tab label of remote files don't show the whole path
-Star prepended to the tab label when changes occur. Star removed when
tab is activited

The only things I plan to add are:
- splitting, so you can display several tails side by side
- fixes and cleanups

links:
summary page: http://rubyforge.org/projects/logtails/
download page: http://rubyforge.org/frs/?group_id=500
Good to see the app progressing rapidly - 4 releases with lots of extra
functionality added in a short time - it must be RAD. And I hope you can
tell people at FOSDEM about your experiences..

Maybe I can carry on tweaking the KDevelop based 'long winded release'
version that has the full KDE build system and so on, as it's a good
example app. For instance, KDE has its own mechanism for saving and
restoring session details and configuration settings, which you could use
instead of yaml.

-- Richard
 
A

Alexander Kellett

Maybe I can carry on tweaking the KDevelop based 'long winded release'
version that has the full KDE build system and so on, as it's a good
example app. For instance, KDE has its own mechanism for saving and
restoring session details and configuration settings, which you could
use
instead of yaml.

richard i hope you don't mind me suggesting that you
switch to using a either a) pure ruby build solution,
or b) a cons (yeah python but hell its good from what
i've heard) solution? automake ain't really the nicest
way of packaging up stuff. the packages are bigger
than the source in most cases :/

Alex
 
R

Richard Dale

Alexander said:
richard i hope you don't mind me suggesting that you
switch to using a either a) pure ruby build solution,
or b) a cons (yeah python but hell its good from what
i've heard) solution? automake ain't really the nicest
way of packaging up stuff. the packages are bigger
than the source in most cases :/
I'd like to allow both sort of builds/releases. So it should be possible to
create a KDE project in KDevelop that can be either an automake, or a
mkmf.rb/cons style simpler one. At the moment the KDevelop project template
needs to use automake because it generates a C++ top level stub program to
start the ruby app once it's installed. That isn't needed during
development though, the ruby code can still be run directly.

You need some sort of makefile in the project to run the rbuic tool if a .ui
file changes (and more recently a rbkconfig_compiler rule for using KConfig
XT .kcfg files). And KDE expects to find .rc and .desktop files or icons in
certain places - there are quite a lot of resources apart from the ruby
code that need to be installed.

-- Richard
 
J

Joel VanderWerf

Bauduin said:
Hi,

Logtails 0.4 has arrived ( http://rubyforge.org/frs/?group_id=500 ), and

This is the first qt ruby app I've tried to get working, and I'm having
some problems. I've got KDE 3.2.3 on Mandrake 10.1.

First, I tried qtruby-1.0.6:

$ make -f Makefile.cvs
$ ./configure --with-smoke="qt kde"
$ make
make all-recursive
make[1]: Entering directory `/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6'
Making all in smoke
make[2]: Entering directory `/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6/smoke'
Making all in qt
make[3]: Entering directory
`/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6/smoke/qt'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory
`/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6/smoke/qt'
Making all in kde
/bin/sh: line 1: cd: kde: No such file or directory
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6/smoke'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vjoel/ruby/src/gui/qt/qtruby-1.0.6'
make: *** [all] Error 2

Then I tried korundum-3.3.1:

$ make -f Makefile.cvs
$ ./configure --with-smoke="qt kde"
$ make
...
/bin/sh ../../libtool --silent --mode=link --tag=CXX g++
-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
-Wpointer-arith -Wwrite-strings -O2 -Wformat-security
-Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common
-o qtrubyinit -module -L/usr/X11R6/lib -L/usr/lib/qt3//lib -L/usr/lib
-version-info 0:0:0 -L../../smoke/qt/ -L/usr/local/lib qtrubyinit.o
-lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM -lICE -lpthread -Wl,-R
-Wl,/usr/local/lib -L/usr/local/lib -L. ../../smoke/qt/libsmokeqt.la
../../qtruby/rubylib/qtruby/libqtrubyinternal.la
libtool: link: warning: `-version-info' is ignored for programs
qtrubyinit.o(.text+0xc): In function `main':
: undefined reference to `ruby_init'
qtrubyinit.o(.text+0x1a): In function `main':
: undefined reference to `ruby_script'
qtrubyinit.o(.text+0x29): In function `main':
: undefined reference to `ruby_options'
qtrubyinit.o(.text+0x2e): In function `main':
: undefined reference to `ruby_run'
collect2: ld returned 1 exit status
make[3]: *** [qtrubyinit] Error 1
make[3]: Leaving directory
`/home/vjoel/ruby/src/gui/qt/korundum-3.3.1/qtruby/bin'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/vjoel/ruby/src/gui/qt/korundum-3.3.1/qtruby'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vjoel/ruby/src/gui/qt/korundum-3.3.1'
make: *** [all] Error 2

Any suggestions?
 
J

Joel VanderWerf

Joel said:
Then I tried korundum-3.3.1:

$ make -f Makefile.cvs
$ ./configure --with-smoke="qt kde"
$ make

Oops. That was for qt. I tried to build korundum with:

$ make -f Makefile.cvs
$ ./configure
$ make

I get the impression that korundum includes qtruby. Is that right?
 
R

Richard Dale

Joel said:
Oops. That was for qt. I tried to build korundum with:

$ make -f Makefile.cvs
$ ./configure
$ make

I get the impression that korundum includes qtruby. Is that right?
Yes it does - you only need to download either qtruby or korundum, but not
both. I hope you managed to build korundum ok, the commands above should
work ok.

-- Richard
 
B

Bauduin Raphael

Richard said:
Bauduin Raphael wrote:



Good to see the app progressing rapidly - 4 releases with lots of extra
functionality added in a short time - it must be RAD. And I hope you can
tell people at FOSDEM about your experiences..

Not sure I'll have much time, but it's clearly real fun to program with
Ruby+Korundum. I've obtained the useful too I aimed for in short time,
although I didn't know QT/KDE and Logtails is a low priority side
project, something I code for a change. Adding highlighting was done in
15 minutes (including 10 minutes to read documentation :) , and session
saving+restoring was done in 1 hour.
Maybe I can carry on tweaking the KDevelop based 'long winded release'
version that has the full KDE build system and so on, as it's a good
example app. For instance, KDE has its own mechanism for saving and
restoring session details and configuration settings, which you could use
instead of yaml.

Good idea.
I implemented sessions with yaml because it was easy, but also because
KDE's documentation is not that friendly when you are new to the API....
Having that implemented in Logtails could be a good example.


Raph
 
A

Alexander Kellett

You need some sort of makefile in the project to run the rbuic tool if
a .ui
file changes (and more recently a rbkconfig_compiler rule for using
KConfig
XT .kcfg files). And KDE expects to find .rc and .desktop files or
icons in
certain places - there are quite a lot of resources apart from the ruby
code that need to be installed.

there is a cons based kde specific script available. *somewhere* ;)
Alex
 
C

Cai Li

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

My job is to split the following string which contains some chinese
chars(GB code) and make an array:

"sz000503,????,2005-01-31 15:01:01,<font
color=009933>11.780</font>,11.950,11.800,<font
color=009933>-0.170</font>,11.640,11.930,<font
color=009933>-1.42%</font>,61454,7231.56,11.770,11.790,<font
color=009933>-60.52%</font>,11.77 / 96,11.76 / 197,11.75 / 195,11.79
/ 177,11.80 / 611,11.81 / 424,11.73 / 85,11.72 / 70,11.82 / 528,11.83
/ 873"

my own script looks like this:
def make_array(orig_string)

rb_array = Array.new
elements = ''
orig_string.each_byte {|s|
if sprintf("%c",s) != ',' then
elements = elements + sprintf("%c",s)
else
rb_array.push(elements)
elements = ''
end
}
return rb_array
end

with the following results:
["sz000503", "\272\243\272\347\277\330\271\311", "2005-01-31
15:01:01", "<font c
olor=009933>11.780 said:
", "11.640", "11.930", "<font color=009933>-1.42%</font>", "61454",
"7231.56",
"11.770", "11.790", "<font color=009933>-60.52%</font>", "11.77 /
96", "11.76 /
197", "11.75 / 195", "11.79 / 177", "11.80 / 611", "11.81 / 424",
"11.73 / 85",
"11.72 / 70", "11.82 / 528"]

Almost right except chinese chars.Then how to save chinese?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1

iD8DBQFB/iZGVLC4xCNBi2kRAngyAJ4lJew59t3OpUYFeY3rdt7cW0C/wgCdFk8g
owog0jOeOyJq2OsvbfJlpvk=
=9Unz
-----END PGP SIGNATURE-----
 
R

Robert Klemme

Cai Li said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

My job is to split the following string which contains some chinese
chars(GB code) and make an array:

"sz000503,????,2005-01-31 15:01:01,<font
color=009933>11.780</font>,11.950,11.800,<font
color=009933>-0.170</font>,11.640,11.930,<font
color=009933>-1.42%</font>,61454,7231.56,11.770,11.790,<font
color=009933>-60.52%</font>,11.77 / 96,11.76 / 197,11.75 / 195,11.79
/ 177,11.80 / 611,11.81 / 424,11.73 / 85,11.72 / 70,11.82 / 528,11.83
/ 873"

my own script looks like this:
def make_array(orig_string)

rb_array = Array.new
elements = ''
orig_string.each_byte {|s|
if sprintf("%c",s) != ',' then
elements = elements + sprintf("%c",s)
else
rb_array.push(elements)
elements = ''
end
}
return rb_array
end

Btw, "str.split(/,/)" should do exactly the same and is more efficient.
with the following results:
["sz000503", "\272\243\272\347\277\330\271\311", "2005-01-31
15:01:01", "<font c
olor=009933>11.780 said:
", "11.640", "11.930", "<font color=009933>-1.42%</font>", "61454",
"7231.56",
"11.770", "11.790", "<font color=009933>-60.52%</font>", "11.77 /
96", "11.76 /
197", "11.75 / 195", "11.79 / 177", "11.80 / 611", "11.81 / 424",
"11.73 / 85",
"11.72 / 70", "11.82 / 528"]

Almost right except chinese chars.Then how to save chinese?

Err, what exactly is the problem? I don't see chinese characters, which
is probably doe to my installed encodings. But what result do you want to
get?

Kind regards

robert
 
C

Cai Li

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Btw, "str.split(/,/)" should do exactly the same and is more
efficient.

It's no use :-(
Err, what exactly is the problem? I don't see chinese characters, which
is probably doe to my installed encodings. But what result do you want to
get?

My purpose is to make users read chinese chars clearly but not read
strings like
"\272\243\272\347\277\330\271\311"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1

iD8DBQFB/j1pVLC4xCNBi2kRAgadAJ9z+UEcGTKJlAE7aFD9W/ZcfqtrlQCfZhZk
x6+D3iXlWUtQq1n/LhXAAuo=
=s+Of
-----END PGP SIGNATURE-----
 
R

Robert Klemme

Cai Li said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

efficient.

It's no use :-(

What do you mean by this?
My purpose is to make users read chinese chars clearly but not read
strings like
"\272\243\272\347\277\330\271\311"

This is not a splitting issue but an output issue. Apparently you did
something like "p array", i.e. used String#inspect. Try to do "puts
array" - if your environment supports chinese chars then that should yield
the expected output.

Kind regards

robert
 
C

Cai Li

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is not a splitting issue but an output issue. Apparently you did
something like "p array", i.e. used String#inspect. Try to do "puts
array" - if your environment supports chinese chars then that should yield
the expected output.

Thank you Robert,your suggestion is useful.But,what is the
reason?Because
String#inspect does a silly thing in converting the origin string to
a string
containing a "human-readable" representation of it?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1

iD8DBQFB/tsXVLC4xCNBi2kRAjJNAJ40XOMxiXD+3BFIhDzwgtHdGdgh7QCeLGZz
AZsrjOrruOuQDJImM+kgJdA=
=Bx6J
-----END PGP SIGNATURE-----
 
M

Mark Hubbart

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Thank you Robert,your suggestion is useful.But,what is the
reason?Because
String#inspect does a silly thing in converting the origin string to
a string
containing a "human-readable" representation of it?

Silly or not, it's the default behavior. By default, any non-ascii
characters are escaped in inspected strings - it's assumed that your
terminal can't display anything but ascii. But this is overrideable
behavior: set the kcode ($KCODE="u") at the top of your script, and it
should use the actual characters, where available. This turns on UTF-8
interpretation of characters.

Also, it seems that some people use p( stuff ) without realizing that
it it like calling puts( stuff.inspect ). #inspect, and therefore p,
are primarily debugging tools, intended for use when you want to see
*exactly* what is in the string. This means that unless you tell ruby
differently, it assumes your strings are in ascii format, and #inspect
escapes other characters accordingly. It should escape all whitespace
other than normal spaces, all control characters, and all bytes that
are not valid characters for the current KCODE.

HTH,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top