@@ -24,6 +24,7 @@ It is a `Loguru` based custom logging package for python projects.
2424- Add custom ** handlers**
2525- ** FastAPI** HTTP access logging ** middleware**
2626- ** Base** logging module
27+ - Support ** Pydantic-v1** and ** Pydantic-v2**
2728
2829---
2930
@@ -181,16 +182,16 @@ python ./main.py
181182**Output**:
182183
183184` ` ` txt
184- [2023-09-01 09 :00:00.384 +09:00 | TRACE | beans_logging._base:478]: Intercepted modules: ['concurrent', 'concurrent.futures', 'asyncio']; Muted modules: [];
185- [2023-09-01 09 :00:00.384 +09:00 | TRACE | __main__:7]: Tracing...
186- [2023-09-01 09 :00:00.385 +09:00 | DEBUG | __main__:8]: Debugging...
187- [2023-09-01 09 :00:00.385 +09:00 | INFO | __main__:9]: Logging info.
188- [2023-09-01 09 :00:00.385 +09:00 | OK | __main__:10]: Success.
189- [2023-09-01 09 :00:00.385 +09:00 | WARN | __main__:11]: Warning something.
190- [2023-09-01 09 :00:00.385 +09:00 | ERROR | __main__:12]: Error occured.
191- [2023-09-01 09 :00:00.386 +09:00 | CRIT | __main__:13]: CRITICAL ERROR.
192- [2023-09-01 09 :00:00.386 +09:00 | ERROR | __main__:25]: division by zero
193- [2023-09-01 09 :00:00.386 +09:00 | ERROR | __main__:32]: Show me, what value is wrong:
185+ [2023-09-01 00 :00:00.000 +09:00 | TRACE | beans_logging._base:478]: Intercepted modules: ['concurrent', 'concurrent.futures', 'asyncio']; Muted modules: [];
186+ [2023-09-01 00 :00:00.000 +09:00 | TRACE | __main__:7]: Tracing...
187+ [2023-09-01 00 :00:00.000 +09:00 | DEBUG | __main__:8]: Debugging...
188+ [2023-09-01 00 :00:00.000 +09:00 | INFO | __main__:9]: Logging info.
189+ [2023-09-01 00 :00:00.000 +09:00 | OK | __main__:10]: Success.
190+ [2023-09-01 00 :00:00.000 +09:00 | WARN | __main__:11]: Warning something.
191+ [2023-09-01 00 :00:00.000 +09:00 | ERROR | __main__:12]: Error occured.
192+ [2023-09-01 00 :00:00.000 +09:00 | CRIT | __main__:13]: CRITICAL ERROR.
193+ [2023-09-01 00 :00:00.000 +09:00 | ERROR | __main__:25]: division by zero
194+ [2023-09-01 00 :00:00.000 +09:00 | ERROR | __main__:32]: Show me, what value is wrong:
194195Traceback (most recent call last):
195196
196197> File "/home/user/workspaces/projects/beans_logging/examples/simple/./main.py", line 30, in <module>
@@ -344,22 +345,22 @@ uvicorn main:app --host=0.0.0.0 --port=8000
344345**Output**:
345346
346347` ` ` txt
347- [2023-09-01 14:55:11.724 +09:00 | TRACE | beans_logging._base:576]: Intercepted modules: ['watchfiles.watcher', 'dotenv', 'asyncio', 'dotenv.main', 'watchfiles.main', 'concurrent.futures', 'uvicorn', 'fastapi', 'concurrent', 'watchfiles']; Muted modules: ['uvicorn.access', 'uvicorn.error'];
348- [2023-09-01 14:55:11.740 +09:00 | INFO | uvicorn.server:76]: Started server process [17146]
349- [2023-09-01 14:55:11.740 +09:00 | INFO | uvicorn.lifespan.on:46]: Waiting for application startup.
350- [2023-09-01 14:55:11.741 +09:00 | INFO | main:21]: Preparing to startup...
351- [2023-09-01 14:55:11.741 +09:00 | OK | main:22]: Finished preparation to startup.
352- [2023-09-01 14:55:11.741 +09:00 | INFO | main:23]: API version: 0.0.1-000000
353- [2023-09-01 14:55:11.741 +09:00 | INFO | uvicorn.lifespan.on:60]: Application startup complete.
354- [2023-09-01 14:55:11.745 +09:00 | INFO | uvicorn.server:218]: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
355- [2023-09-01 14:55:17.417 +09:00 | DEBUG | anyio._backends._asyncio:833]: [f635ebbc3f2348db9dcff681be1bd52a] 127.0.0.1 - "GET / HTTP/1.1"
356- [2023-09-01 14:55:17.418 +09:00 | OK | anyio._backends._asyncio:833]: [f635ebbc3f2348db9dcff681be1bd52a] 127.0.0.1 - "GET / HTTP/1.1" 200 17B 0.7ms
357- ^C[2023-09-01 14:55:18.729 +09:00 | INFO | uvicorn.server:264]: Shutting down
358- [2023-09-01 14:55:18.831 +09:00 | INFO | uvicorn.lifespan.on:65]: Waiting for application shutdown.
359- [2023-09-01 14:55:18.834 +09:00 | INFO | main:26]: Praparing to shutdown...
360- [2023-09-01 14:55:18.835 +09:00 | OK | main:27]: Finished preparation to shutdown.
361- [2023-09-01 14:55:18.837 +09:00 | INFO | uvicorn.lifespan.on:76]: Application shutdown complete.
362- [2023-09-01 14:55:18.837 +09:00 | INFO | uvicorn.server:86]: Finished server process [17146]
348+ [2023-09-01 00:00:00.000 +09:00 | TRACE | beans_logging._base:576]: Intercepted modules: ['watchfiles.watcher', 'dotenv', 'asyncio', 'dotenv.main', 'watchfiles.main', 'concurrent.futures', 'uvicorn', 'fastapi', 'concurrent', 'watchfiles']; Muted modules: ['uvicorn.access', 'uvicorn.error'];
349+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.server:76]: Started server process [17146]
350+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.lifespan.on:46]: Waiting for application startup.
351+ [2023-09-01 00:00:00.000 +09:00 | INFO | main:21]: Preparing to startup...
352+ [2023-09-01 00:00:00.000 +09:00 | OK | main:22]: Finished preparation to startup.
353+ [2023-09-01 00:00:00.000 +09:00 | INFO | main:23]: API version: 0.0.1-000000
354+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.lifespan.on:60]: Application startup complete.
355+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.server:218]: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
356+ [2023-09-01 00:00:00.000 +09:00 | DEBUG | anyio._backends._asyncio:833]: [f635ebbc3f2348db9dcff681be1bd52a] 127.0.0.1 - "GET / HTTP/1.1"
357+ [2023-09-01 00:00:00.000 +09:00 | OK | anyio._backends._asyncio:833]: [f635ebbc3f2348db9dcff681be1bd52a] 127.0.0.1 - "GET / HTTP/1.1" 200 17B 0.7ms
358+ ^C[2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.server:264]: Shutting down
359+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.lifespan.on:65]: Waiting for application shutdown.
360+ [2023-09-01 00:00:00.000 +09:00 | INFO | main:26]: Praparing to shutdown...
361+ [2023-09-01 00:00:00.000 +09:00 | OK | main:27]: Finished preparation to shutdown.
362+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.lifespan.on:76]: Application shutdown complete.
363+ [2023-09-01 00:00:00.000 +09:00 | INFO | uvicorn.server:86]: Finished server process [17146]
363364` ` `
364365
365366---
0 commit comments