Back to LoggerRegistry class

Method getLoggerClass

public string
getLoggerClass
(string $key)
Get the logger class for a given key
Parameters
  • string $key The key to look up
Returns
  • string
Since
  • 4.0.0
-
  • \InvalidArgumentException

Method getLoggerClass - Source code

/**
 * Get the logger class for a given key
 *
 * @param   string  $key  The key to look up
 *
 * @return  string
 *
 * @since   4.0.0
 * @throws  \InvalidArgumentException
 */
public function getLoggerClass(string $key) : string
{
    if (!$this->hasLogger($key)) {
        throw new \InvalidArgumentException("The '{$key}' key is not registered.");
    }
    return $this->loggerMap[$key];
}