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โ
- Configuration Guide - Detailed configuration options
- Usage Guide - How to use logging in your code
- Output Formats - Available output formats and examples
- Performance - Performance considerations and optimizations
Key Featuresโ
- Transparent Logging - No code changes needed, just configuration
- Configuration-Driven - Control everything via application.properties
- Hierarchical Configuration - Global settings cascade to specific categories
- Custom Messages - Add context with ActionConfig logging methods
- Session Management - Track workflows with ActionSessionManager
- Visual Indicators - Clear symbols (โ โ โ) for action status
- Concise Format - One-line summaries with essential information
- Multiple Output Formats - SIMPLE, STRUCTURED, and JSON
- Performance Optimized - Minimal overhead with early filtering
- No Special Services - Just use the standard Action class