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
ConstructorsConstructorDescriptionConstructs a new ConsoleLogHandler and initializes the JSON mapper. -
Method Summary
Modifier and TypeMethodDescriptionai.nervemind.common.service.ExecutionLogHandler.LogLevelGet the current minimum logging level.voidhandle(ai.nervemind.common.service.ExecutionLogHandler.LogEntry entry) booleanReturns whether the log handler is currently enabled.booleanReturns whether context data is included in the output.voidsetEnabled(boolean enabled) Set the enabled state of the log handler.voidsetIncludeContext(boolean includeContext) Set whether to include context data in the log output.voidsetMinLevel(ai.nervemind.common.service.ExecutionLogHandler.LogLevel minLevel) Set the minimum logging level to display.
-
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:
handlein interfaceai.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
-