LogInfo( $line ); } public static function LogDebug( $line, $context = null ) { if ( ! ATKPLog::$logenabled ) { return; } ATKPLog::$log->LogDebug( $line ); if ( $context != null ) { ATKPLog::$log->LogDebug( ATKPLog::contextToString( $context ) ); } } /** * Takes the given context and coverts it to a string. * * @param array $context The Context * * @return string */ protected static function contextToString( $context ) { $export = ''; foreach ( $context as $key => $value ) { $export .= "{$key}: "; $export .= preg_replace( array( '/=>\s+([a-zA-Z])/im', '/array\(\s+\)/im', '/^ |\G /m' ), array( '=> $1', 'array()', ' ' ), str_replace( 'array (', 'array(', var_export( $value, true ) ) ); $export .= PHP_EOL; } return str_replace( array( '\\\\', '\\\'' ), array( '\\', '\'' ), rtrim( $export ) ); } public static function LogWarn( $line ) { if ( ! ATKPLog::$logenabled ) { return; } ATKPLog::$log->LogWarn( $line ); } public static function LogError( $line ) { if ( ! ATKPLog::$logenabled ) { return; } ATKPLog::$log->LogError( $line ); } }