carb::logging::stringToLevel

Defined in carb/logging/Log.h

inline int32_t carb::logging::stringToLevel(const char *levelString)

Convert a given string to a log level.

Compares the given levelString against kStringToLevelMappings to find a match. Only the first character is checked in a case insensitive manner.

Parameters

levelString – A string representing the name of a log level. nullptr is interpreted as kLevelFatal. Only the first character of the string is checked in a case insensitive manner.

Returns

The integer Log Levels determined from levelString. If a level could not be determined, kLevelFatal is returned after an error log is issued.