Class LogTrigger

  • All Implemented Interfaces:
    java.util.EventListener, IvyListener, Trigger

    public class LogTrigger
    extends AbstractTrigger
    A trigger performing logging.

    The implementation is widely inspired by Ant Echo task.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean append  
      private java.lang.String encoding
      encoding; set to null or empty means 'default'
      private java.io.File file  
      private static java.lang.String LINE_SEPARATOR  
      private java.lang.String message  
    • Constructor Summary

      Constructors 
      Constructor Description
      LogTrigger()  
    • Field Detail

      • LINE_SEPARATOR

        private static final java.lang.String LINE_SEPARATOR
      • message

        private java.lang.String message
      • file

        private java.io.File file
      • append

        private boolean append
      • encoding

        private java.lang.String encoding
        encoding; set to null or empty means 'default'
    • Constructor Detail

      • LogTrigger

        public LogTrigger()
    • Method Detail

      • progress

        public void progress​(IvyEvent event)
      • log

        protected void log​(java.lang.String message)
        Logs the given message.
        Parameters:
        message - the message to log
      • setMessage

        public void setMessage​(java.lang.String msg)
        Message to write.
        Parameters:
        msg - Sets the value for the message variable.
      • setFile

        public void setFile​(java.io.File file)
        File to write to.
        Parameters:
        file - the file to write to, if not set, echo to standard Ivy logging
      • setAppend

        public void setAppend​(boolean append)
        If true, append to existing file.
        Parameters:
        append - if true, append to existing file, default is false.
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
        Declare the encoding to use when outputting to a file; Use "" for the platform's default encoding.
        Parameters:
        encoding - the character encoding to use.