Răsfoiți Sursa

return logger on setLoggerChannel function

CauseFX 4 ani în urmă
părinte
comite
fe5b1fbe4a
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 5 1
      api/functions/log-functions.php

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

@@ -227,7 +227,9 @@ trait LogFunctions
 			}
 			}
 			if ($setLogger) {
 			if ($setLogger) {
 				$channel = $channel ?: 'Organizr';
 				$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);
 		$loggerBuilder->setLogLevel($logLevel);
 		try {
 		try {
 			$this->logger = $loggerBuilder->build();
 			$this->logger = $loggerBuilder->build();
+			return $this->logger;
 		} catch (Exception $e) {
 		} catch (Exception $e) {
 			// nothing so far
 			// nothing so far
 			$this->logger = null;
 			$this->logger = null;
+			return $this->logger;
 		}
 		}
 		/* setup:
 		/* 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):
 		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):