Choosing Serial port using #define directive

I want to be able to set which Serial port gets my debugging messages, depending on the setting of a single directive.

With Serial 1 to Serial 3, this is simple enough - I make each "print" using a variable that holds the serial definition, with the definition set using a directive:

HardwareSerial *mySerialPort;
#ifdef USE_SERIAL2

mySerialPort->println(F("Here is a test message"));

BUT - what if I want the option to use SerialUSB? Trying to set


I get "error: cannot convert 'Serial_' to 'HardwareSerial' in assignment"

Any suggestions?

Why so complicated?

#define SerialDEBUG Serial1
// or #define SerialDEBUG SerialUSB

void setup() {
  // put your setup code here, to run once:
  SerialDEBUG.println("That is an test");


Thanks - much much better!