protected function interpolateContext ($sMessage, array $aContext)
    {
        // build a replacement array with braces around the context keys
        $aReplace = array();
        foreach ($aContext as $sKey => $mValue) {
            $sValue = (string)$mValue;
            $aReplace['{' . trim($sKey) . '}'] = $sValue;
        }

        // interpolate replacement values into the message and return
        return strtr($sMessage, $aReplace);
    }