OpenMake Meister

omLogger

 

In your Build Method, immediately prior to the compile step, call

omlogger("Begin",$StepDescription,"ERROR:","$StepDescription succeeded.",

$Compiler,$CompilerArguments,$IncludeNL,$RC,@CompilerOut);

 

After the compile step call omlogger('final').

if ($RC != 0)

{

 omlogger("Final",$StepDescription,"ERROR:","ERROR: $StepDescription

    failed",$Compiler,$CompilerArguments,"",$RC,@CompilerOut);

 $RC = 1;

}

else

{

 omlogger("Final",$StepDescription,"ERROR:","$StepDescription

    succeeded.",$Compiler,$CompilerArguments,"",$RC,@CompilerOut),

}

 

Below is the list of arguments that must be passed to the compiler. Defaults are not inherited from the program body. This omission is designed to avoid picking up unintended values.  Following are the arguments in the order in which they must be supplied:

$StepStatus,$StepDescription,$RegExp,$LastLine,$Compiler, $CompilerArguments, $IncludeNL, $RC,@CompilerOut

 

$StepStatus may be one of the values below (case insensitive):

Begin - Prints the compile command to be executed (Step Header). Will print New Target Header (HTML only) and Script Header,  if they have not already been printed.

        

Intermediate - Prints the results of the compile operation step (Step Footer), but WITHOUT the Script Footer; it is therefore assumed that further compile steps will follow during the execution of this Build Method, but before the Footer is finally written.  It also prints the New Target Header (HTML only), the Script Header and the Compile Command that was executed, if they have not already been printed. 

        

Final - Prints the results of the compile operation along WITH the Script Footer and, if applicable, New Target Footer (HTML only).  It will print a New Target Header (HTML only), Script Header and Step Header, if they have not already been printed. Typically, the last compile step in a Build Method uses this option.

       

In general, the execution of a build step will be preceded by a call to omlogger with "StepStatus" set to "Begin", followed by a call with "StepType" set to "Intermediate", "Final" or "Abort", depending on the outcome. A generic compile step should be called within a Build Method, as follows:

 

omlogger("Begin",$StepDescription,"ERROR:","$StepDescription succeeded.", $Compiler,$CompilerArguments,$IncludeNL,$RC,@CompilerOut);

@CompilerOut = `$Compiler $CompilerArguments 2>&1`; $RC = $?;

if ($RC != 0)

{

 omlogger("Final",$StepDescription,"ERROR:","ERROR: $StepDescription

 failed",$Compiler,$CompilerArguments,"",$RC,@CompilerOut);

 $RC = 1;

}

else

{

 omlogger("Final",$StepDescription,"ERROR:","$StepDescription succeeded.",

 $Compiler,$CompilerArguments,"",$RC,@CompilerOut),

}

 

A set of global variables determine if all necessary headers have been written, and writes them if necessary.

 

omlogger reads the following global variables:

          $main::HeaderBreak -> {"true","false"}

            $main::ScriptDefault -> {"initial","done"}

and uses them to set the variables below:

            $main::HeaderBreakHTML -> {"true","false"}

            $main::ScriptDefaultHTML -> {"initial","done"}

            $main::ScriptDefaultTEXT -> {"initial","done"}

            $main::StepLoggingHTML -> {"initial","done"}   

            $main::StepLoggingTEXT -> {"initial","done"}   

 

HeaderBreak - If the current Build Method is the very first script called for the build of the current final target, then HeaderBreak is set to "true" by om. It is set  to "false" for all subsequent script calls of that final target. This variable is used by omlogger to write out an HTML Final Target Header  (om automatically writes this header to STDOUT),

 

ScriptDefault - is set by om to "initial" at the beginning of every script execution. This variable is used by omlogger to decide whether or not the step to be logged is the first step to be executed in the current script.

 

StepLoggingHTML - managed internally by omlogger to determine if a step header has already been printed.

 

StepLogginTEXT -  managed internally by omlogger to determine if a step header has already been printed.

 

Variables Used by omlogger:

    $VPath (Openmake::SearchPath)

    $Project

    $VPathName

    $User

    $BuildDirectory

    $BuildMachine

    $LogfileName

    $Target (Openmake::File)

    $BuildType

    $FinalTarget (Openmake::File)

    $Defines