#log

built-in shelf

Purpose

#log is one of the built-in string sinks, and the standard log stream for OmniMark. OmniMark places all errors and informative messages to #log, but it will accept user-defined strings as well.

If no -log nor -alog option is given on the command line, #log is equivalent to #error.

The following code illustrates the use of #log for reporting errors:

  global integer list-size
  
  process
     local integer items variable 
  
     ; ...
  
     using output as #log
     do when number of items != list-size
        output "The list contains the wrong number of items:"
            || " list-size = " || "d" % list-size || ", but list-items has "
            || "d" % number of items || " item(s).%n"
        halt with 2 ; signals an error condition while stopping
     done
          

This sink is always unbuffered and in text-mode and cannot be declared otherwise. In any program that uses referents, #log is treated as if it were opened with referents-displayed.