Skip to main content
Version: Latest

Brobot Logging System

Transparent, Configuration-Driven Loggingโ€‹

The Brobot framework provides transparent, built-in logging that requires no code changes or special services. Simply use the standard Action class methods (click(), find(), type(), etc.), and logging happens automatically based on your application.properties configuration.

Key Principle: Logging is a cross-cutting concern that should be transparent to your automation code. You write normal automation logic, and Brobot handles the logging based on your configuration.

Core Conceptsโ€‹

Log Levelsโ€‹

Brobot uses industry-standard SLF4J/Log4j2 log levels:

  • OFF - No logging
  • ERROR - Error conditions requiring attention
  • WARN - Warning conditions and potential issues
  • INFO - Key business events and action results
  • DEBUG - Detailed debugging information
  • TRACE - Most detailed information including method entry/exit

Log Categoriesโ€‹

Different aspects of automation are organized into categories:

  • ACTIONS - User actions (click, type, find)
  • TRANSITIONS - State transitions and navigation
  • MATCHING - Pattern matching details
  • PERFORMANCE - Timing and performance metrics
  • STATE - State management events
  • LIFECYCLE - Application lifecycle events
  • VALIDATION - Input validation and checks
  • SYSTEM - System-level events

Add custom log messages directly to your action configurations:

Add custom log messages directly to your action configurations:

PatternFindOptions options = new PatternFindOptions.Builder()
.withBeforeActionLog("Searching for login button...")
.withSuccessLog("Login button found!")
.withFailureLog("Login button not found - check page state")
.build();

// Use perform() method with ActionConfig for custom logging
action.perform(options, loginButton);

Sample Outputโ€‹

With transparent logging enabled, you'll see:

Standard actions (automatic logging only):

โ†’ CLICK usernameField
โœ“ CLICK usernameField | loc:(245,180) | sim:0.91 | 32ms
โ†’ TYPE "user123"
โœ“ TYPE "user123" | 125ms
โ†’ CLICK loginButton
โœ“ CLICK loginButton | loc:(520,380) | sim:0.92 | 45ms

With custom messages:

Searching for login button...
โ†’ FIND loginButton
โœ“ FIND loginButton | loc:(520,380) | sim:0.92 | 45ms
Login button found!

Failed action:

โ†’ CLICK submitButton
โœ— CLICK submitButton | NOT FOUND | 5003ms

Documentation Structureโ€‹

Key Featuresโ€‹

  1. Transparent Logging - No code changes needed, just configuration
  2. Configuration-Driven - Control everything via application.properties
  3. Hierarchical Configuration - Global settings cascade to specific categories
  4. Custom Messages - Add context with ActionConfig logging methods
  5. Session Management - Track workflows with ActionSessionManager
  6. Visual Indicators - Clear symbols (โ†’ โœ“ โœ—) for action status
  7. Concise Format - One-line summaries with essential information
  8. Multiple Output Formats - SIMPLE, STRUCTURED, and JSON
  9. Performance Optimized - Minimal overhead with early filtering
  10. No Special Services - Just use the standard Action class