completely remade the whole logging system, ready for teh pi now!