Bots/Instrumentation: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
* what we need is a database module for logging | * what we need is a database module for logging | ||
* logging functionality may need fixing... | * logging functionality may need fixing... | ||
approach: | |||
* passing full information to logging object | |||
* logging object decides what to do | |||
* want to be able to say, dump to log file, dump to database | |||
* enable log file dumping and set a log dump file | |||
* enable database dumping and set connection information | |||
==code== | ==code== | ||
Revision as of 05:04, 3 February 2018
notes
Categorizing bots:
- currently, we have logging capacity
- what we need is a database module for logging
- logging functionality may need fixing...
approach:
- passing full information to logging object
- logging object decides what to do
- want to be able to say, dump to log file, dump to database
- enable log file dumping and set a log dump file
- enable database dumping and set connection information
code
https://charlesreid1.com:3000/charlesreid1/apollospacejunk
https://charlesreid1.com:3000/charlesreid1/rainbow-mind-machine
def _tweet(self,twit):
"""
Private method.
Publish a twit.
"""
# call twitter api to tweet the twit
try:
# tweet:
#stats = self.t.statuses.update(status=twit)
self.t.statuses.update(status=twit)
msg = self.timestamp_message(">>> Tweet was successful: %s"%(twit))
logging.info(msg)