using public member function instead of private member when logging