소스 검색

return logger on setLoggerChannel function

CauseFX 4 년 전
부모
커밋
fe5b1fbe4a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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):