Question about the print library

Hi all,
I'm working with the Arduino for a while now and i've been debugging my code with output from the Serial port.

I've realized that the "Serial.print/ln" commands takes a lot of time , so what i did was to create another class that wraps the Serial.print and Serial.println commands and adds a another boolean variable that indicates debug/production mode.

Now, everything works just fine except for when i'm trying to print a long variable in a different base.

this one works fine:
Serial.print(lMsgCounter, HEX);
and this one is not:
print.MyPrint(lMsgCounter, bDebugMode, HEX);

my function is as follows:
size_t PRINT::MyPrintln(long lLong, bool bDebugMode, int nBase/= DEC/)
{
if (bDebugMode)
{
return Serial.println(lLong, nBase);
}

return 0;
}

when i tried to print the nBase variable i'm getting "1" value each time.

I've seen another interesting thing about the definition of Serial.print, from print.h:
size_t print(long, int = DEC);

my question is what is the "int = DEC" means?

and adds a another boolean variable that indicates debug/production mode.

Typically, "production" software has all (or most) debug code removed, not merely disabled.

maybe so, but i want to keep my options (it's still an early stage).

yuval_sh:
maybe so, but i want to keep my options (it's still an early stage).

So, make better use of the preprocessor.

my question is what is the "int = DEC" means?

Would it help if I told you that the value of DEC is 10, and the mechanism you're asking about is C++'s way of specifying default parameters?.

I already know that. I want to know why when i send a different base (HEX) it's not working as i expect?

I already know that.

So why did you ask

my question is what is the "int = DEC" means?

?

I know that it's what it's suppose to do, but it seems that something else is going on here that i am not aware of.
As i said, i tried to print the base itself inside the function and instead of "16", which is HEX, it prints "1". So if "= DEC" works fine then what else is wrong?