"Using proper logging instead of print statements is a recommended practice in software development for a variety of reasons. \n",
"\n",
"While print statements can be helpful for quick debugging, logging provides a more powerful and versatile approach. \n",
"\n",
"Logging allows for better control over output, with options to configure log levels, filter messages, and redirect output to different destinations. \n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "a31b2245",
"metadata": {
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"import qim3d\n",
"log = qim3d.log"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8a2b7c0e",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"warning level message\n",
"error level message\n",
"critical level message\n"
]
}
],
"source": [
"# Here we test by sending one message for each level\n",