Skip to content

Instantly share code, notes, and snippets.

@ichux
Created April 26, 2025 15:54
Show Gist options
  • Save ichux/c761e89bccc16b3c8c1643c078c222f0 to your computer and use it in GitHub Desktop.
Save ichux/c761e89bccc16b3c8c1643c078c222f0 to your computer and use it in GitHub Desktop.
import logging
logging.basicConfig(
**{
"level": logging.DEBUG,
"format": "%(asctime)s - %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
}
)
class DataManager:
def __init__(self):
self._latest_data = {}
@property
def latest_data(self):
return self._latest_data
@latest_data.setter
def latest_data(self, value):
self._latest_data = value
dm = DataManager()
if __name__ == "__main__":
dm.latest_data = True
logging.info(dm.latest_data)
dm.latest_data = False
logging.info(dm.latest_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment