Skip to main content

Logging functions used in the CogWorks lab.

Project description

Installation

pycogworks.logging can be installed with ‘pip’:

# pip install pycogworks.logging

Documentation

pycogworks.logging.getTime, pycogworks.logging.get_time

Returns the most accurate timestamp possible for the current OS.

>>> getTime()
1348684524.934422
>>> get_time()
1348684540.905437

pycogworks.logging.getDateTimeStamp

Generates a date/time stamp usefull in logs and for log filenames.

>>> getDateTimeStamp()
'2012-09-26_13-33-06'

pycogworks.logging.writeHistoryFile

Takes a dict of subject information and writes a history file. The subject information dict must contain a field called ‘rin’ with a value that contains a valid 9 digit RIN. If the subject information dict does not already contain an ‘encrypted_rin’ field, the RIN will be enrypted and added to the subject information dict under the field ‘encrypted_rin’. The subject information dict is then encoded as a JSON string and written to a file.

>>> writeHistoryFile("test.history",{"foo":"bar","rin":"123456789"})
# cat test.history
{
  "cipher": "AES/CBC (RIJNDAEL) - 16Byte Key",
  "encrypted_rin": "300fe9abdca99d4a32cb2c43f2a69c5c",
  "foo": "bar",
  "rin": "123456789"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycogworks.logging-0.4.5.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file pycogworks.logging-0.4.5.tar.gz.

File metadata

File hashes

Hashes for pycogworks.logging-0.4.5.tar.gz
Algorithm Hash digest
SHA256 060bafb91d9450006a20162f1ebe1d8af095137ac8ef16a353d62ffe511c7116
MD5 9c6309d54f1b881e807714d85ec611ab
BLAKE2b-256 4ec6aff44a2759bf480e5d762761c9dd9907d6d5f022c6d29f96010cc976b51c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page