engforge.datastores.data.DiskCacheStore

class DiskCacheStore(*args, **kwargs)[source]

Bases: LoggingMixin

A singleton object with safe methods for file access, Aims to prevent large number of file pointers open

These should be subclassed for each cache location you want

Initialize a filter.

Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.

Methods

add_fields

Overwrite this to modify logging fields

change_all_log_lvl

critical

A routine to communicate to the root of the server network that there is an issue

debug

Writes at a low level to the log file.

error

Writes to log as a error

expire

wrapper for diskcache expire method that only permits expiration on a certain interval :return: bool, True if expired called

extract_message

filter

This acts as the interface for logging.Filter Don't overwrite this, use add_fields instead.

get

Helper method to get an item, return None it doesn't exist and warn.

info

Writes to log but with info category, these are important typically and inform about progress of process in general

installSTDLogger

We only want std logging to start

message_with_identiy

converts to color and string via the termcolor library :type message: str :param message: a string convertable entity :type color: :param color: a color in [grey,red,green,yellow,blue,magenta,cyan,white]

msg

Writes to log.

resetLog

reset log

resetSystemLogs

resets log on all internal instance LoggingMixins

set

Passes default arguments to set the key:data relationship :param expire: time in seconds to expire the data

slack_notification

warning

Writes to log as a warning

Attributes

alt_path

cache

cache_init_kwargs

cache_path

cache_root

current_keys

expire_threshold

identity

last_expire

log_fmt

log_level

log_on

logger

proj_dir

proj_root

retries

size_limit

slack_webhook_url

sleep_time

timeout

add_fields(record)

Overwrite this to modify logging fields

cache_class

alias of Cache

critical(*args)

A routine to communicate to the root of the server network that there is an issue

debug(*args)

Writes at a low level to the log file… usually this should be detailed messages about what exactly is going on

error(error, msg='')

Writes to log as a error

expire()[source]

wrapper for diskcache expire method that only permits expiration on a certain interval :return: bool, True if expired called

filter(record)

This acts as the interface for logging.Filter Don’t overwrite this, use add_fields instead.

get(key=None, on_missing=None, retry=True, ttl=None)[source]

Helper method to get an item, return None it doesn’t exist and warn. :type on_missing: :param on_missing: a callback to use if the data is missing, which will set the data at the key, and return it

info(*args)

Writes to log but with info category, these are important typically and inform about progress of process in general

installSTDLogger()

We only want std logging to start

message_with_identiy(message, color=None)

converts to color and string via the termcolor library :type message: str :param message: a string convertable entity :type color: :param color: a color in [grey,red,green,yellow,blue,magenta,cyan,white]

Parameters:

message (str)

msg(*args, lvl=5)

Writes to log… this should be for raw data or something… least priorty

resetLog()

reset log

resetSystemLogs(reseted=None)

resets log on all internal instance LoggingMixins

set(key=None, data=None, retry=True, ttl=None, **kwargs)[source]

Passes default arguments to set the key:data relationship :param expire: time in seconds to expire the data

warning(*args)

Writes to log as a warning