{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logging\n",
    "\n",
    "Use the following helper method to log MI Scripting Toolkit operations to a folder. This folder will be created in one\n",
    "of the following locations depending on platform:\n",
    "\n",
    "* Windows: `%LOCALAPPDATA%\\Granta Design\\MIScriptingToolkit\\Python`\n",
    "* Linux: `~/.appdata/Granta Design/MIScriptingToolkit/Python`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from GRANTA_MIScriptingToolkit import granta as mpy\n",
    "\n",
    "# Sets the Foundation API logger to log to a file in \n",
    "# %LOCALAPPDATA%\\Granta Design\\MIScriptingToolkit\\Python\\MIScriptingToolkitForPython_YYYY.MM.DD.log\n",
    "# or on Linux...\n",
    "# ~/.appdata/Granta Design/MIScriptingToolkit/Python/MIScriptingToolkitForPython_YYYY.MM.DD.log\n",
    "mpy.log_to_file_in_local_app_data(path='Granta Design\\\\MIScriptingToolkit\\\\Python')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "Note: The MI Scripting Toolkit's underlying C libraries will still perform their own logging, which can be found in\n",
    "`%LOCALAPPDATA%\\Granta Design\\MIScriptingToolkit` (or the Linux equivalent). This does not affect logging through\n",
    "Python."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
