Google\Cloud\Logging\Logger::getLogLevelMap PHP Method

getLogLevelMap() public static method

Returns the log level map.
public static getLogLevelMap ( )
    public static function getLogLevelMap()
    {
        return self::$logLevelMap;
    }

Usage Example

 public function getLogger()
 {
     $connection = $this->prophesize(ConnectionInterface::class);
     $connection->writeEntries(Argument::any())->will(function ($entries) {
         $map = Logger::getLogLevelMap();
         $entry = $entries[0]['entries'][0];
         $severity = is_int($entry['severity']) ? strtolower($map[$entry['severity']]) : $entry['severity'];
         self::$logs[] = sprintf('%s %s', $severity, $entry['jsonPayload']['message']);
     });
     $logger = new Logger($connection->reveal(), 'my-log', 'projectId');
     return new PsrLogger($logger);
 }
All Usage Examples Of Google\Cloud\Logging\Logger::getLogLevelMap