Bots/Instrumentation: Difference between revisions
From charlesreid1
No edit summary |
m (Replacing charlesreid1.com:3000 with git.charlesreid1.com) |
||
| (One intermediate revision by the same user not shown) | |||
| 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== | ||
https://charlesreid1.com | https://git.charlesreid1.com/charlesreid1/apollospacejunk | ||
https://charlesreid1.com | https://git.charlesreid1.com/charlesreid1/rainbow-mind-machine | ||
https://charlesreid1.com | https://git.charlesreid1.com/charlesreid1/rainbow-mind-machine/src/master/rainbowmindmachine/Sheep.py#L348 | ||
<pre> | <pre> | ||
Latest revision as of 03:18, 9 October 2019
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://git.charlesreid1.com/charlesreid1/apollospacejunk
https://git.charlesreid1.com/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)