Hi Than,

In the class Service there are two constructors:

public Service()
        {
                this.S = new Settings();
                this.logger = new Logger(this.S);
                listSystemInformation();
                this.gatewayList = new ArrayList<AGateway>();
                this.reorderMessageQueue = new 
PriorityQueue<OutboundMessage>(50,
new Comparator<OutboundMessage>()
                {
                        public int compare(OutboundMessage x, OutboundMessage y)
                        {
                                int comp = x.getPriority() - y.getPriority();
                                if (comp == 0) comp = 
x.getDate().compareTo(y.getDate());
                                return comp;
                        }
                });
                setRouter(new Router(this));
                setLoadBalancer(new RoundRobinLoadBalancer(this));
        }

        /**
         * Service constructor. Will set SMSLib to use the provided log4j
logger.
         *
         * @param myLogger
         *            A ready log4j logger to use.
         */
        public Service(Logger myLogger)
        {
                this.S = new Settings();
                this.logger = new Logger(this.S);
                listSystemInformation();
                this.gatewayList = new ArrayList<AGateway>();
                this.reorderMessageQueue = new 
PriorityQueue<OutboundMessage>(50,
new Comparator<OutboundMessage>()
                {
                        public int compare(OutboundMessage x, OutboundMessage y)
                        {
                                int comp = x.getPriority() - y.getPriority();
                                if (comp == 0) comp = 
x.getDate().compareTo(y.getDate());
                                return comp;
                        }
                });
                setRouter(new Router(this));
                setLoadBalancer(new RoundRobinLoadBalancer(this));
        }

But the second constructor is the same as the fist in my oppinion.
The myLogger variable is never used!
I tried to set another loglevel, but this cant work.
If you have a look at this constructor even the Debug=true Flag set
from within code cant work if you just create new settings by calling
this.S = new Settings() and afterwards building a new logger, which
uses this fresh new settings. In this case the default settings will
alway be used.
In my code I had:

service = new Service();
service.S.debug=true;

But this will never have any effect, because the logger is already
instantiated and configured with the default.
And because of the not used myLogger variable in the second
constructor I dont know any way to set a custom loglevel.
Can anyone help me?

Greets

Casjen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SMSLib Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/SMSLib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to