Class LogUtil

java.lang.Object
io.deephaven.logging.LogUtil

public class LogUtil extends Object
Utility class to help format logging messages.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.fishlib.io.log.LogEntry
    appendDeltaTimeMillis(com.fishlib.io.log.LogEntry entry, long startMillis, long endMillis)
    Append a delta time expressed as fractional seconds to a LogEntry.
    static com.fishlib.io.log.LogEntry
    appendTimeMillis(com.fishlib.io.log.LogEntry entry, long millis)
    Append time expressed as fractional seconds to a LogEntry.
    static com.fishlib.io.logger.Logger
    setupProcessUnsafeLogger(String logName, com.fishlib.configuration.Configuration conf)
    Create a logger using com.fishlib.logger.ProcessUnsafeLogCreator and set it up as a standard logger for a process.
    static com.fishlib.io.logger.Logger
    setupProcessUnsafeLogger(String logName, com.fishlib.configuration.Configuration conf, String logPath, int rollIntervalMs)
    Create a logger using com.fishlib.logger.ProcessUnsafeLogCreator and set it up as a standard logger for a process.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogUtil

      public LogUtil()
  • Method Details

    • setupProcessUnsafeLogger

      public static com.fishlib.io.logger.Logger setupProcessUnsafeLogger(String logName, com.fishlib.configuration.Configuration conf)
      Create a logger using com.fishlib.logger.ProcessUnsafeLogCreator and set it up as a standard logger for a process.
      Parameters:
      logName - the basename to use for the log file. A common choice is a program's main class simple name.
      conf - the configuration to use to set up the logger.
      Returns:
      a Logger object configured and ready to be used
    • setupProcessUnsafeLogger

      public static com.fishlib.io.logger.Logger setupProcessUnsafeLogger(String logName, com.fishlib.configuration.Configuration conf, String logPath, int rollIntervalMs)
      Create a logger using com.fishlib.logger.ProcessUnsafeLogCreator and set it up as a standard logger for a process.
      Parameters:
      logName - the basename to use for the log file. A common choice is a program's main class simple name.
      conf - the configuration to use to set up the logger
      logPath - the directory where to store the logs
      rollIntervalMs - the time period to use to roll the logs
      Returns:
      a Logger object configured and ready to be used
    • appendDeltaTimeMillis

      public static com.fishlib.io.log.LogEntry appendDeltaTimeMillis(com.fishlib.io.log.LogEntry entry, long startMillis, long endMillis)
      Append a delta time expressed as fractional seconds to a LogEntry.
      Parameters:
      entry - The LogEntry where to do the log appending.
      startMillis - The absolute time in milliseconds where the delta period to log starts.
      endMillis - The absolute time in milliseconds where the delta period to log ends.
      Returns:
      the modified LogEntry to support chaining of operations
    • appendTimeMillis

      public static com.fishlib.io.log.LogEntry appendTimeMillis(com.fishlib.io.log.LogEntry entry, long millis)
      Append time expressed as fractional seconds to a LogEntry.
      Parameters:
      entry - The LogEntry where to do the log appending.
      millis - Time to log in milliseconds.
      Returns:
      the modified LogEntry to support chaining of operations