Class ConsoleLogHandler

java.lang.Object
ai.nervemind.app.service.ConsoleLogHandler
All Implemented Interfaces:
ai.nervemind.common.service.ExecutionLogHandler

@Component public class ConsoleLogHandler extends Object implements ai.nervemind.common.service.ExecutionLogHandler
Console log handler that outputs structured logs to SLF4J. Formats log entries for human readability while preserving structure.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ai.nervemind.common.service.ExecutionLogHandler

    ai.nervemind.common.service.ExecutionLogHandler.LogCategory, ai.nervemind.common.service.ExecutionLogHandler.LogEntry, ai.nervemind.common.service.ExecutionLogHandler.LogLevel
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new ConsoleLogHandler and initializes the JSON mapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.nervemind.common.service.ExecutionLogHandler.LogLevel
    Get the current minimum logging level.
    void
    handle(ai.nervemind.common.service.ExecutionLogHandler.LogEntry entry)
     
    boolean
    Returns whether the log handler is currently enabled.
    boolean
    Returns whether context data is included in the output.
    void
    setEnabled(boolean enabled)
    Set the enabled state of the log handler.
    void
    setIncludeContext(boolean includeContext)
    Set whether to include context data in the log output.
    void
    setMinLevel(ai.nervemind.common.service.ExecutionLogHandler.LogLevel minLevel)
    Set the minimum logging level to display.

    Methods inherited from class Object

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

    • ConsoleLogHandler

      public ConsoleLogHandler()
      Constructs a new ConsoleLogHandler and initializes the JSON mapper.
  • Method Details

    • handle

      public void handle(ai.nervemind.common.service.ExecutionLogHandler.LogEntry entry)
      Specified by:
      handle in interface ai.nervemind.common.service.ExecutionLogHandler
    • setEnabled

      public void setEnabled(boolean enabled)
      Set the enabled state of the log handler.
      Parameters:
      enabled - whether to enable the log handler
    • isEnabled

      public boolean isEnabled()
      Returns whether the log handler is currently enabled.
      Returns:
      true if enabled
    • setMinLevel

      public void setMinLevel(ai.nervemind.common.service.ExecutionLogHandler.LogLevel minLevel)
      Set the minimum logging level to display.
      Parameters:
      minLevel - the minimum log level to output
    • getMinLevel

      public ai.nervemind.common.service.ExecutionLogHandler.LogLevel getMinLevel()
      Get the current minimum logging level.
      Returns:
      the minimum log level
    • setIncludeContext

      public void setIncludeContext(boolean includeContext)
      Set whether to include context data in the log output.
      Parameters:
      includeContext - whether to include JSON context in logs
    • isIncludeContext

      public boolean isIncludeContext()
      Returns whether context data is included in the output.
      Returns:
      true if context is included