ponty / pysimavr

python wrapper for simavr which is AVR and arduino simulator
GNU General Public License v3.0
49 stars 14 forks source link

Logger #19

Closed Premik closed 7 years ago

Premik commented 7 years ago

Hi, When I enable debug level logging.basicConfig(level=logging.DEBUG) the console got flooded with repeating message like: "atmega2560 reset"

Seems there is regression in the 47175c7ff68de93b570d8a97d012fcf20c52475c. The buf[256] got never truncated inside the _mem_logger_readline so the last line is being read over and over.

ponty commented 7 years ago

Can you show me your program?

Here is my program:

import logging
from pysimavr.avr import Avr
from time import sleep

logging.basicConfig(level=logging.DEBUG)

if __name__ == "__main__":
    avr = Avr(mcu='atmega2560', f_cpu=8000000)
    sleep(2)
    avr.step(1)
    avr.step(1)
    sleep(2)
    avr.terminate()

output:

DEBUG:pysimavr.avr:mcu=atmega2560 f_cpu=8000000
DEBUG:pysimavr.logger:Starting atmega2560 - flashend 3ffff ramend 21ff e2end 0fff
DEBUG:pysimavr.logger:atmega2560 init
DEBUG:pysimavr.logger:atmega2560 reset
DEBUG:pysimavr.avr:terminating...
DEBUG:pysimavr.avr:...ok
ponty commented 7 years ago

OK I found it. I had to rebuild the C extension.

Premik commented 7 years ago

Yeah. I've actually already patched this one. Let me on PR.

ponty commented 7 years ago

Fixed