Logging on CLI console.

Hi,

when a script is run thru the CLI console, only the connection commands are displayed. Incase of errors , even the errors are displayed.

If user freindly messages need to be shown we use the command:
write "string" to error.
However, is there a way to output all the contents that are logged in the results log.txt on the console. Basically the complete execution of the script should be visible on the console screen.

Thanks in advance.

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    There isn't currently a simple option to enable that, but it's a really good idea and so perhaps we will introduce a way to turn that on in a future release of Eggplant.

    In the meantime you could do something like this to get that information displayed:
    try
    	myMainScript
    	write (file logFile of first item of scriptResults()) to error
    catch
    	-- We still want to log it and raise the exception if it fails
    	write (file logFile of first item of scriptResults()) to error
    	throw exceptionName(), exceptionReason()
    end catch
    
  • Is this still the only way to print out to the cli what gets logged to the log file?

    We run from the command line and would like to be able to 'watch' what is happening as it happens by viewing the log file output.
  • JonathanOSXJonathanOSX ForumAdmin admin
    Fortunately we have improved that. As of Eggplant 3.10 (August 2006) we have the following options available to you:

    ? Added the CommandLineOutput global property to control whether output is sent to standard output while running a script from the command line. This can also be set using an option on the command line. When set to 'true' or 'on', all of the output that would usually be displayed in the Log Area of the Run window will be sent to standard output (stdout). Using this property, you can control exactly which sections of a script produce output and which sections don't:
    set the CommandLineOutput to ON
    -- do stuff whose output you want to see
    set the CommandLineOutput to OFF

    ? Command Line Interface:

    Can now turn CommandLineOutput on for scripts using -CommandLineOutput YES argument when starting scripts from the command line.
  • that worked great. thanks!
  • Fortunately we have improved that. As of Eggplant 3.10 (August 2006) we have the following options available to you:

    � Added the CommandLineOutput global property to control whether output is sent to standard output while running a script from the command line. This can also be set using an option on the command line. When set to 'true' or 'on', all of the output that would usually be displayed in the Log Area of the Run window will be sent to standard output (stdout). Using this property, you can control exactly which sections of a script produce output and which sections don't:
    set the CommandLineOutput to ON
    -- do stuff whose output you want to see
    set the CommandLineOutput to OFF

    � Command Line Interface:



    Can now turn CommandLineOutput on for scripts using -CommandLineOutput YES argument when starting scripts from the command line.

    Hi
    I am new to eggplant and was trying to execute the scripts from the console (OS being windows 7),though i was able to execute the scripts i was not able to see any log statements being displayed on the console even after setting the arguement -CommandLineOutput to YES

    the syntax i followed was :
    C:\Program Files\Eggplant\Eggplant.app>runscript "C:\Documents\TestScript.script" -CommandLineOuput YES

    (Test Script Contains only a log statement )
  • EggplantMattEggplantMatt ForumAdmin admin
    I'm not sure why that wouldn't be working for you. I just tested it and it output everything I would expect it to show in the Run window, including the Log statements. Tested on both XP and Win 7. Are you sure that your script ran? If your script wasn't executed for some reason, then you wouldn't see any output from it.
Sign In or Register to comment.