             }
         }
         
+        // Forward log events to the master.
+        addEventListener(for: fuzzer.events.Log) { ev in
+            let msg = LogMessage(level: ev.level.rawValue, label: ev.label, content: ev.message)
+            let encoder = JSONEncoder()
+            let payload = try! encoder.encode(msg)
+            self.conn.sendMessage(payload, ofType: .log)
+        }
+        
         // Start corpus synchronization.
         requestCorpusSync()
         

                logger.warning("Received malformed statistics update from worker")
            }
            
        default:
            logger.warning("Received unexpected packet from worker")
        }

    /// Can be imported by workers to quickly replicate the state of the master.
    /// See the fastWorkerSync config option for more information.
    case evaluatorState = 8
    
    /// Log messages are forwarded from workers to masters.
    case log            = 9
}

/// Payload of an identification message.
fileprivate struct Identification: Codable {
    let workerId: UUID
}

/// Payload of a log message.
fileprivate struct LogMessage: Codable {
    let level: Int
    let label: String
    let content: String
}

fileprivate let messageHeaderSize = 8
