I got a python error where it shows the logger object as Logger, changing the lower-case "l" to an "L". here's the error:
Traceback (most recent call last):
File "/Users/user/PycharmProjects/stocks/stock-watchlist/Notes.py", line 195, in <module>
logger.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S')
AttributeError: 'Logger' object has no attribute 'basicConfig'
Language: Python IDE: PyCharm PyCharm 2021.1 (Community Edition) Build #PC-211.6693.115, built on April 6, 2021 Runtime version: 11.0.10+9-b1341.35 x86_64 VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o. macOS 12.4 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Non-Bundled Plugins: IdeaVIM (1.9.2), Key Promoter X (2021.1.1), cn.haojiyou.CodeGlance3 (2.0.1), com.mallowigi (36.0), com.markskelton.one-dark-theme (5.6.0), com.nasller.CodeGlancePro (1.3.8-Last2021.3.x), com.tabnine.TabNine (0.7.2), io.acari.DDLCTheme (78.2-1.1.1), io.unthrottled.amii (0.14.1), zd.zero.waifu-motivator-plugin (2.2.0), izhangzhihao.rainbow.brackets (6.24), org.exbin.deltahex.intellij (0.2.6)
As @Jhon Gordon mentioned:
Logger
is the type of object, not its name.
The logger = logging.getLogger(__name__)
uses the getLogger()
method which has the same name as my variable explaining why it appeared like the compiler-error changed the case of the letter, it was pure coincidance.