Browse Source

New feature "Log non-essential commands" and --script_log_all_commands

master
Thomas Schmitt 10 years ago
parent
commit
ce0ff5e4ae
  1. 8
      frontend/README-tcltk
  2. 50
      frontend/xorriso-tcltk
  3. 2
      xorriso/xorriso_timestamp.h

8
frontend/README-tcltk

@ -65,7 +65,7 @@ So here is the output of xorriso-tcltk --help :
------------------------------------------------------------------------
Usage:
/usr/bin/xorriso-tcltk [options]
frontend/xorriso-tcltk [options]
Options:
All options must be given with two dashes ("--option") in
order to distinguish them from any options of the Tcl shell.
@ -105,9 +105,11 @@ Options:
reply messages and enable this logging.
The log lines will be appended. Path "-" means stderr.
--script_log_file path
Set a file address for logging of major xorriso commands
and enable this logging.
Set a file address for logging of essential xorriso
commands and enable this logging.
The log lines will be appended. Path "-" means stderr.
--script_log_all_commands
With logging of commands log non-essential commands too.
If neither --stdio nor --named_pipes is given, then this script
will try to locate itself in the filesystem and start a xorriso

50
frontend/xorriso-tcltk

@ -21,7 +21,7 @@
set own_version "1.2.7"
# Minimum version of xorriso to be used as backend provess.
# Minimum version of xorriso to be used as backend process.
# Older versions of xorriso do not offer commands -msg_op and -launch_frontend
set min_xorriso_version "1.2.6"
@ -68,9 +68,11 @@ proc print_usage {argv0} {
puts stderr " reply messages and enable this logging."
puts stderr " The log lines will be appended. Path \"-\" means stderr."
puts stderr " --script_log_file path"
puts stderr " Set a file address for logging of major xorriso commands"
puts stderr " and enable this logging."
puts stderr " Set a file address for logging of essential xorriso"
puts stderr " commands and enable this logging."
puts stderr " The log lines will be appended. Path \"-\" means stderr."
puts stderr " --script_log_all_commands"
puts stderr " With logging of commands log non-essential commands too."
puts stderr ""
puts stderr "If neither --stdio nor --named_pipes is given, then this script"
puts stderr "will try to locate itself in the filesystem and start a xorriso"
@ -193,6 +195,9 @@ set cmd_log_target ""
# Whether to log essential commands: 0=off , 1=no extract , 2=with extract
set cmd_logging_mode 0
# Whether to log all commands if cmd_logging_mode is 1: 0=off , 1=on
set cmd_logging_all 0
# The last logged -cd path. Used to prevent redundant logging of -cd.
set recent_cd_path ""
@ -240,6 +245,7 @@ proc send_async_cmd {cmd} {
global cmd_sent cmd_conn debug_logging debug_log_conn
display_busy 1
log_command $cmd 0
debug_log_puts \
" =============================================================="
@ -270,7 +276,7 @@ proc send_marked_cmd {cmd} {
# Send a command and make it a candidate for the log script
#
proc send_loggable_cmd {cmd} {
log_command $cmd
log_command $cmd 1
send_marked_cmd $cmd
}
@ -2006,7 +2012,7 @@ proc refresh_avail {} {
set line "n.a."
reset_highest_cmd_sev
clear_sieve
send_marked_cmd "-tell_media_space"
send_loggable_cmd "-tell_media_space"
if {[compare_sev $highest_cmd_sev "FAILURE"] < 0} {
set ac ""
read_sieve "After commit :"
@ -3538,7 +3544,7 @@ proc init_gui {} {
#
proc init_input {} {
global borderwidth busy_text_exists xorriso_version debug_logging
global cmd_logging_mode cmd_log_target osirrox_allowed
global cmd_logging_mode cmd_log_target osirrox_allowed cmd_logging_all
global .input .input_line1 .xorriso_version .busy .busy_text
global .refresh_state .end_button .cmdline .log_pipes_switch
@ -3579,6 +3585,10 @@ proc init_input {} {
-command "effectuate_command_logging 0" \
-variable cmd_logging_mode \
-onvalue 1 -offvalue 0
$m add checkbutton -label "Log non-essential commands" \
-indicatoron 1 -selectcolor "" \
-variable cmd_logging_all \
-onvalue 1 -offvalue 0
$m add command -label "Set log script address" \
-command "set_log_script_address"
$m add separator
@ -4539,6 +4549,10 @@ the xorriso state, but only those which set up that state and those which
get sent via the \"Command:\" field.
Commands -osirrox and -extract will be logged only as comments.
The \"Log non-essential commands\" switch controls whether all commands
shall be logged if \"Log command script\" is enabled. Commands
-msg_op \"parse\" and -msg_op \"parse_bulk\" will be logged only as comments.
The item \"Set log script address\" pops up a file tree browser window
which asks for the target of appending to script. Address \"-\" means
standard error. Else it must not yet exist or be a writable data file.
@ -4815,6 +4829,9 @@ See xorriso command -stream_recording."
burn a data file from hard disk onto the output drive.
The address of the disk file is taken from the neighboring text field.
No input drive may be aquired. (Delete all characters from the field
\"Input drive/image\" and hit Return to give up the input drive.)
The medium in the drive must be blank.
(It is well possible to burn image files to appendable media. But the
@ -5517,14 +5534,20 @@ proc yell_xorriso_tcltk {} {
# Log a command (if enabled)
#
proc log_command {cmd} {
global cmd_log_conn cmd_logging_mode recent_cd_path
proc log_command {cmd essential} {
global cmd_log_conn cmd_logging_mode cmd_logging_all recent_cd_path
if {$cmd_logging_mode < 1} {return ""}
if {$essential <= 0} {
if {$cmd_logging_all <= 0} {return ""}
} else {
# Leave logging to non-essential call which will come soon after
if {$cmd_logging_all > 0} {return ""}
}
if {[string first "-cd " $cmd] == 0} {
set path [string range $cmd 4 end]
if {$path == $recent_cd_path} {return ""}
if {$path == $recent_cd_path && $cmd_logging_all <= 0} {return ""}
set recent_cd_path $path
}
@ -5539,6 +5562,9 @@ proc log_command {cmd} {
set prefix "# "
}
}
if {[string first "-msg_op parse" $cmd] != -1} {
set prefix "# "
}
puts $cmd_log_conn $prefix$cmd
flush $cmd_log_conn
}
@ -5713,7 +5739,7 @@ proc escape_newline {text backslash_too} {
proc setup_by_args {argv0 argv} {
global cmd_pipe_adr reply_pipe_adr main_window_geometry click_to_focus
global have_bwidget cmd_conn reply_conn geometry stdout stdin
global osirrox_allowed
global osirrox_allowed cmd_logging_all
# wish normally eats the -geometry option and puts the result into $geometry
catch {set main_window_geometry $geometry}
@ -5779,6 +5805,10 @@ proc setup_by_args {argv0 argv} {
# postpone actual log start until start_xorriso has been passed
set script_logging 1
}
if {$opt == "--script_log_all_commands"} {
set ok "1"
set cmd_logging_all 1
}
if {$opt == "--no_extract"} {
set ok "1"
set osirrox_allowed 0

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2013.01.14.094419"
#define Xorriso_timestamP "2013.01.15.104804"

Loading…
Cancel
Save