http://bugzilla.suse.com/show_bug.cgi?id=943757
http://bugzilla.suse.com/show_bug.cgi?id=943757#c7
Ancor Gonzalez Sosa changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |shundhammer@suse.com
Flags| |needinfo?(shundhammer@suse.
| |com)
--- Comment #7 from Ancor Gonzalez Sosa ---
As I see it, we have two options.
1) Fix RedirectToLog. I don't know why it was changed from y2logs to /dev/null,
but I can imagine at least one reason: coupling of libyui and YaST.
Btw, it was HuHa who made it, past always comes back. :-)
https://github.com/libyui/libyui-ncurses/commit/3e10a9a29905056b9cf2b6ef746a...
2) Implement the same mechanism in YaST (and Ruby). This script works.
require "yast"
include Yast::UIShortcuts
# We'd need to expose get_log_filename through yast-ruby-bindings.
# Let's fake it for demo purposes
module Yast
def self.get_log_filename; "/var/log/YaST2/y2log"; end
end
# We'd need to call this before NCurses::init
# (still to be decided exactly when/where)
def redirect_std_streams
[$stderr, $stdout].each do |stream|
if stream.tty?
stream.reopen(Yast.get_log_filename, "a")
stream.sync = true
end
end
end
# Let's call it here for the demo
redirect_std_streams
module Yast
import "UI"
UI.OpenDialog(PushButton("Hello, World!"))
# Al this messages works as expected (logging to YaST logs)
$stderr.puts "Hello, stderr! 2"
$stderr.puts "Halo", "stderr!", "2"
$stderr.print "Hola, ! 2"
$stderr.print "Ahoj", "stderr!", "2"
UI.UserInput
UI.CloseDialog
end
I'd like to know what Martin and HuHa think about it. Maybe they even remember
the reason for the /dev/null thingy.
--
You are receiving this mail because:
You are on the CC list for the bug.