"""
Structured logging, noSQL database, and diagnostic administration
"""
from __future__ import division, absolute_import

import structlog
from structlog import BoundLoggerBase, PrintLogger, wrap_logger
from structlog.processors import JSONRenderer, KeyValueRenderer
from pprint import pprint
from tinydb import TinyDB, where
from tinydb.storages import MemoryStorage, JSONStorage
from tinydb.middlewares import CachingMiddleware

from collections import OrderedDict
from PyDSTool import info  # use for viewing log dicts
import json

import datetime
import time
import hashlib
import sys, os

__all__ = ['diagnostic_manager', 'get_unique_name', 'info', 'load_log',
           'where', 'filter_log']


global name_registry
name_registry = {}

def get_unique_name(name, start=None):
    """
    Use optional start integer to begin numbering of the name with that value
    """