constructor() {
      this.middlewares = [];
    }
Registers a new middleware function.
- Validates that middleware is a function
- Logs error if invalid middleware provided
- Adds valid middleware to execution chain

@param {Function} middleware - Function(context, next)
@returns {void}
@throws {Error} Logs error for non-function middleware