XBee Event logging, creating CSV file.


I am logging change of state values within my Python program… I am using XBee ZigBee. The python XBee documentation provides Event Log documentation. It gives code and general concept about loggers, handlers, and formatters. However, looking elsewhere (YouTube etc.) I have simply used a logging.basicConfig method at the top of my code. like so:

logging.basicConfig(filename=‘test.csv’, level=logging.INFO, format=‘%(asctime)s:%(levelname)s:%(message)s’)

and then whenever I want to log variable I just put a logging.info (or any particular level, debug,warning, etc) after the variable.

so my concern/question is, what am I missing? I didnt really use any of the XBee python log event approach as provided by the XBee documentation… I used the simple approach as clarified above. There must be a catch, too easy. Any problems with what am I doing? am I missing anything? Did I successfully create a CSV file?

like… I can change the filename=‘test.csv’ to filename=‘test.monkeys’ and then another file is opened called test.monkeys… is this a monkeys file type? My IDE recognizes the .csv one I made and prompts me to use a csv plugin… but not for the .monkeys file… no monkeys plugin lolol :D…

so anyways… did I really create a csv file or did I just call something a name that ends in “.csv”? no clue

thanks :slight_smile:

This would not be an XBee issue but more of a Python issue.

well, to make it more XBee specific… when I log specified event info of my XBee device network… not only do I get the logging of the specified event, but also many many lines of unwanted logging information, from opening the local device to the I/O configuration of all the pins on all the xbe modules in the network. So, xbee built in method includen built in logging, yay or nay?


What documentation are you referring to? What is the link to it?


^XBee Python Library^

I think you need to take a closer look at the logging function offered and how it works. Also what code is needed for it to work properly.

oh, absolutely. apply this to all things.