Skip to content

Instantly share code, notes, and snippets.

View ericgray's full-sized avatar

Eric Gray ericgray

View GitHub Profile
@liviaerxin
liviaerxin / README.md
Last active May 16, 2025 16:09
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
@j05h
j05h / FixKeyboardSettings
Created April 2, 2015 14:24
AppleScript to change the keyboard modifier settings. Yosemite doesn't remember these settings
# AppleScript to change the keyboard modifier settings. Yosemite doesn't remember these
# and reverts whenever you plug in a new keyboard.
# Options on the pane go from bottom to top of the window (at least in this case)
# If you use this, load it up in to Script Editor, run it. Assuming it works,
# Export to an application and save to the desktop. From there, you can execute
#x-help-script://com.apple.machelp/scpt/OpnPrefsBndID.scpt?com.apple.preference.keyboard
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"