alnzng commented on code in PR #103:
URL: https://github.com/apache/flink-agents/pull/103#discussion_r2267673584


##########
api/src/main/java/org/apache/flink/agents/api/AgentsExecutionEnvironment.java:
##########
@@ -86,6 +91,64 @@ public static AgentsExecutionEnvironment 
getExecutionEnvironment() {
         return getExecutionEnvironment(null);
     }
 
+    /**
+     * Enable an event logger for the execution environment.
+     *
+     * <p>This method allows users to set a custom EventLogger that will be 
used to log events
+     * during agent execution.
+     *
+     * @param eventLogger Custom EventLogger instance.
+     * @return The current AgentsExecutionEnvironment instance for method 
chaining.
+     */
+    public AgentsExecutionEnvironment enableEventLogger(EventLogger 
eventLogger) {
+        return enableEventLogger(eventLogger, EventFilter.ACCEPT_ALL);
+    }
+
+    /**
+     * Enable an event logger with a filter for the execution environment.
+     *
+     * <p>This method allows users to set a custom EventLogger along with an 
EventFilter to control
+     * which events are logged. This is useful for reducing noise and focusing 
on relevant events.
+     *
+     * @param logger Custom EventLogger instance.
+     * @param filter EventFilter to apply to logged events.
+     * @return The current AgentsExecutionEnvironment instance for method 
chaining.
+     */
+    public AgentsExecutionEnvironment enableEventLogger(EventLogger logger, 
EventFilter filter) {
+        this.eventLogger = EventLogger.withFilter(logger, filter);
+        return this;
+    }

Review Comment:
   Exactly! I was considering to uses configs as the user-facing APIs to enable 
event logger or listener, but I didn't do this just because we don't have 
config supporrted. I'm happy to refactor this part once the config mechanism is 
available.
   
   @GreatEugenius Let me know once you have some things about new config 
mechanism can share, I can help take a look.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to