Skip to content

Instantly share code, notes, and snippets.

View makcfd's full-sized avatar

Maksim Fediushkin makcfd

  • Passau, Germany
View GitHub Profile
@makcfd
makcfd / README.md
Created June 9, 2025 21:20 — forked from liviaerxin/README.md
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@makcfd
makcfd / concurrent.kafka.consumer.py
Created February 2, 2025 18:19 — forked from pvsune/concurrent.kafka.consumer.py
A multiprocess multithreaded Kafka consumer
#!/usr/bin/env python
import logging
import os
import threading
import time
from multiprocessing import Process
from queue import Queue
from confluent_kafka import Consumer
@makcfd
makcfd / settings.json
Created September 18, 2022 13:20 — forked from Bazulenkov/settings.json
Пример настройки settings.json в VSCode
{
"python.terminal.activateEnvInCurrentTerminal": true, // автоматически активировать виртуальное окружение
"python.linting.enabled": true, // линтер включен
"files.autoSave": "onFocusChange", // автоматически сохранять файл при переключенни на другое окно
"editor.rulers": [
80 // рисует линию, где заканчивается 80-й символ строки
],
"python.formatting.provider": "black", // использовать Black в качестве форматтера
"python.formatting.blackArgs": [
"--line-length", // длина строки 79 символов