8000 🚀 Feature: Expand "development" mode logs. · Issue #5732 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🚀 Feature: Expand "development" mode logs. #5732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
byawitz opened this issue Jun 20, 2023 · 1 comment
Open
2 tasks done

🚀 Feature: Expand "development" mode logs. #5732

byawitz opened this issue Jun 20, 2023 · 1 comment
Labels
enhancement New feature or request product / self-hosted Issues only found when self-hosting Appwrite

Comments

@byawitz
Copy link
Member
byawitz commented Jun 20, 2023

🔖 Feature description

As of now the setting of the _APP_ENV flag inside the .env file affects only a few things in the output logs.

Maybe, It could be a good idea to add another level:

  • production
  • development
  • verbose

In the verbose level, Appwrite will log any possible data.

For example, this code can be something like this:

try {
   $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
  } catch (Duplicate $th) {
   if (App::isVerbose()) {
    Console::error($th);
    Console::error(print_r(debug_backtrace(), true));
  }

  throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS);
}

The isDevelopment can include the isVerbose option - so no code change is required for this part - for example:"

  public static function isDevelopment(): bool
    {
        return self::MODE_TYPE_DEVELOPMENT === self::$mode || self::MODE_TYPE_VERBOSE === self::$mode;
    }

Of course, the log of each part with the backtrace can be enclosed inside a function.

🎤 Pitch

Sometimes errors can have more details, and, getting the full backtrace can also help to get the big picture.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@joeyouss joeyouss self-assigned this Jun 21, 2023
@joeyouss
Copy link

Thank you for the feedback. I don't think so we have had a discussion about this before but it is interesting. This would help add an additional check before deploying to production but would require significant thought from our end. I will pass on the feedback to the team and keep this open for the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / self-hosted Issues only found when self-hosting Appwrite
Projects
None yet
Development

No branches or pull requests

4 participants
0