Prechádzať zdrojové kódy

return logger on setLoggerChannel function

CauseFX 4 rokov pred
rodič
commit
fe5b1fbe4a
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      api/functions/log-functions.php

+ 5 - 1
api/functions/log-functions.php

@@ -227,7 +227,9 @@ trait LogFunctions
 			}
 			if ($setLogger) {
 				$channel = $channel ?: 'Organizr';
-				$this->setupLogger($channel, $username);
+				return $this->setupLogger($channel, $username);
+			} else {
+				return $this->logger;
 			}
 		}
 	}
@@ -272,9 +274,11 @@ trait LogFunctions
 		$loggerBuilder->setLogLevel($logLevel);
 		try {
 			$this->logger = $loggerBuilder->build();
+			return $this->logger;
 		} catch (Exception $e) {
 			// nothing so far
 			$this->logger = null;
+			return $this->logger;
 		}
 		/* setup:
 		set the log channel before you send log (You can set an optional Username (2nd Variable) | If user is logged already logged in, it will use their username):