Skip to content
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

[DOCS] for sample: monitor-cloud-logging : logging submodule #1153

Open
mouadessalim opened this issue Jul 13, 2024 · 1 comment
Open

[DOCS] for sample: monitor-cloud-logging : logging submodule #1153

mouadessalim opened this issue Jul 13, 2024 · 1 comment

Comments

@mouadessalim
Copy link

Which sample?

What is the issue with this sample's docs?

Description:

I encountered an issue while trying to use the logger submodule from the firebase_functions module. According to the documentation and examples, it seems like there should be a logger submodule available, but it doesn't exist in the installed package.

Steps to Reproduce:

  1. Install firebase_functions using pip.

  2. Attempt to import the logger submodule as shown below:

    from firebase_functions import logger
  3. Run the script.

Expected Behavior:
The logger submodule should be imported without any errors.

Actual Behavior:
The following error is raised: ImportError: cannot import name 'logger' from 'firebase_functions' (/path/to/venv/lib/python3.12/site-packages/firebase_functions/init.py)

@GroXXo989
Copy link

Check that you have the latest version of firebase-functions installed. I had the same issue and checked pip to see that I was on version 0.1.2 for some reason when setting up firebase functions as explained in their docs.

If you are using a venv inside your firebase functions folder, you can simply activate the environment using

venv\Scripts\activate

on Windows. The Path for Linux should be slightly different but similar. After activting the venv, you can use

pip list

to show the currently installed packages with their version and

pip install --upgrade firebase-functions

to install the latest version which should contain the logging module.

The only question left is why Firebase installs such an old version of firebase-functions when running the firebase init functions command to create a python functions directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants