31 private const CHANNEL_NAME =
'Translate.Jobs';
39 if ( $this->logger ) {
43 $this->logger = LoggerFactory::getInstance( self::CHANNEL_NAME );
47 protected function getLogPrefix(): string {
48 $prefix = $this->getType();
49 if ( isset( $this->title ) ) {
50 $prefix .=
' [' . $this->title->getPrefixedText() .
']';
58 protected function logInfo( $msg, $context = [] ) {
59 $this->getLogger()->info( $this->getLogPrefix() . $msg, $context );
62 protected function logDebug( $msg, $context = [] ) {
63 $this->getLogger()->debug( $this->getLogPrefix() . $msg, $context );
66 protected function logError( $msg, $context = [] ) {
67 $this->getLogger()->error( $this->getLogPrefix() . $msg, $context );
70 protected function logWarning( $msg, $context = [] ) {
71 $this->getLogger()->warning( $this->getLogPrefix() . $msg, $context );