c++ - How can I set different log locations with static logger -


i have mfc c++ library called program. library big ol class opos device. opos class has many other classes make call static logger. logger either outputs file or console (depending on registry setting) other day made 2 instances of class , set logging of instance 1 log1.log , instance 2 log2.log

well since logging static part of instance 1 logged log1. when instance 2 made both instance 1 , instance 2 write log2. asked if fixed. got thiking , can't figure out how that. i've been doing c++ year , i'm not super versed in , can't think of solution. tips?

a little i've done try i've checked currentthread, currentprocess, incoming dispatchid , same. other suggestions?

although don't idea of amount of work if had change logging static non-static suppose if way would.

i think maintaining log file/console handle within static logging class, need either make logging non-static or let log-open return handle calling routines subsequently pass log-write methods.


Comments