Tailing a log file

Tailing a log file

4
NewbieNewbie
4

    Dec 12, 2007#1

    I have a Windows shortcut to a log file that I want to open and immediately go to the bottom of the file (to see a build result.)

    Ideally there would be a way for me to "Tail" the log file so that UEdit wouldn't ask me every time the file has changed whether I want to reload it.

    But I'd at least settle for a way to go to the bottom of the file when I open it.

    I tried using the command line parameter "-L" but you have to specify a valid line number. (Can't use 9999999)

    I tried recording a quick macro with "Bottom" command, but can't seem to find any way to get UEdit to actually run the macro from a command in the shortcut.

    Any help would be greatly appreciated.

    Alex

    6,682583
    Grand MasterGrand Master
    6,682583

      Dec 12, 2007#2

      If you have recorded a macro which contains only the command Bottom and saved this macro into a macro file which does not contain any other macros, following command line should do it:

      "UE prog path\uedit32.exe" "Path to your log file\log file name with extension" /M="path of macro file\macro file name.mac"

      You should open Configuration - File Handling - File Change Detection, look and read help for this configuration dialog. Polling is a feature introduced for viewing log files opened once and automatically reloaded when modified in the background.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Dec 12, 2007#3

        Thanks for the reply. I tried this but I get the following error message from UEdit after successfully opening the file:

        C:\Program Files\UltraEdit-32\="c:\Program Files\UltraEdit-32\scripts\tail.MAC contains an invalid path.

        Note the single double quote in the middle.

        I'm wondering if Windows isn't doing something to my command line parameters when you enter them into a shortcut.

        6,682583
        Grand MasterGrand Master
        6,682583

          Dec 13, 2007#4

          azvenigo wrote:I'm wondering if Windows isn't doing something to my command line parameters when you enter them into a shortcut.
          Yes, if you have not specified the command line EXACTLY as I have posted with the 6 double quotes and the 2 spaces between the EXE, file to open and macro command line parameter.

          Check your command line again.

          It looks like there is no space between ending double quote of the file to open and the parameter /M=".."
          Best regards from an UC/UE/UES for Windows user from Austria

          4
          NewbieNewbie
          4

            Dec 13, 2007#5

            Just checked. It was exact.
            Here is the exact line verbatim:

            "C:\Program Files\UltraEdit-32\uedit32.exe" "C:\logs\build\platform.log" /M="c:\Program Files\UltraEdit-32\scripts\tail.MAC"

            The error message from UltraEdit was the same. No luck. :-/

            262
            MasterMaster
            262

              Dec 13, 2007#6

              I tried to recreate the same with a shortcut with this target:

              "C:\Program Files\IDM Computer Solutions\UltraEdit-32\uedit32.exe" "c:\temp\temp.xml" /M="c:\temp\tail.mac"

              and got 2 different reactions:

              - when UE was not running before clicking the shortcut = Worked perfect. It opened the file, "fired the macro" and I was positioned at the bottom.

              - when UE was running the error message read:
              "C:\Program Files\IDM Computer Solutions\UltraEdit-32\="c:\temp\tail.mac"

              So close UE before using the shortcut or checkmark to configuration option:
              Advanced - Configuration - Application Layout - Miscellaneous - Allow multiple instances

              _ _ _ _

              Edited:

              Or else create an onload macro that takes care of your file like this:

              IfNameIs "temp"
              IfExtIs "xml"
              Bottom
              EndIf
              EndIf


              For my example with temp.xml - see menu Macro - Set macro for file load/save - and then just simply click the file in the filesystem and not a shortcut.

              6,682583
              Grand MasterGrand Master
              6,682583

                Dec 13, 2007#7

                If UE is already running when you start it and then this happens, you could also use additionally parameter /fni (force new instance) available since UE v13.10 on the command line. Or you use one of the 2 suggestions by jorrasdk.

                It would be interesting if all this is really necessary if polling for this file is used with the polling option When a file marked for polling is detected as changed scroll to the last line in the file (Use for tailing log files) is also set. I have never used polling because I don't have to view always a log file updated by another task and therefore I don't really know.
                Best regards from an UC/UE/UES for Windows user from Austria

                4
                NewbieNewbie
                4

                  Dec 13, 2007#8

                  Yes that was it! UE was already running and apparently it has a bug when passing command line parameter commands from one running instance to another. (It's actually a very tricky problem as I had to solve this for another application I wrote.)

                  Thanks for all the feedback.