- * Enables the given loglevel.
- *
- */
-void add_loglevel(const char *level) {
- /* Handle the special loglevel "all" */
- if (strcasecmp(level, "all") == 0) {
- loglevel = UINT64_MAX;
- return;
- }
-
- for (int i = 0; i < sizeof(loglevels) / sizeof(char*); i++) {
- if (strcasecmp(loglevels[i], level) != 0)
- continue;
-
- /* The position in the array (plus one) is the amount of times
- * which we need to shift 1 to the left to get our bitmask for
- * the specific loglevel. */
- loglevel |= (1 << (i+1));
- break;
- }
-}
-
-/*
- * Returns the offsets for the next write and for the last wrap.
- * Necessary to print the i3 SHM log in the correct order.