beautypg.com

Nortel Networks NN46120-104 User Manual

Page 280

background image

280

Using the Port Forwarder API

public void log(final int logLevel, final int logCode,

final Object[] params, final Throwable throwable) {

if ((logLevel == PortForwarderConstants.LOG_LEVEL_ERROR) ||

(logLevel == PortForwarderConstants.LOG_LEVEL_INFO)) {

String msg =

MessageFormat.format(messages.getString("" + logCode),

params);

String messageString = createMessage(msg);

if (portForwarderGui == null) {

System.err.println("WARNING: Could not write to info area!

");

System.err.println(messageString);

if (throwable != null) {

System.out.println(throwable.getMessage());

throwable.printStackTrace();

}

} else {

portForwarderGui.appendInfo(messageString +

System.getProperty("line.separ

ator"));

if (throwable != null) {

portForwarderGui.appendInfo(throwable.getMessage() +

System.getProperty("line.se

parator"));

throwable.printStackTrace();

}

}

}

}

public void log(final int logLevel, final String msg,

final Throwable throwable) {

if (logLevel != PortForwarderConstants.LOG_LEVEL_DEBUG_VERBOSE) {

String messageString = createMessage(msg);

if (portForwarderGui == null) {

System.err.println("WARNING: Could not write to info area!

");

System.err.println(messageString);

if (throwable != null) {

System.out.println(throwable.getMessage());

throwable.printStackTrace();

}

} else {

portForwarderGui.appendInfo(messageString +

System.getProperty("line.separator"));

if (throwable != null) {

portForwarderGui.appendInfo(throwable.getMessage() +

System.getProperty("line.separ

ator"));

throwable.printStackTrace();

}

Nortel VPN Gateway

User Guide

NN46120-104

02.01

Standard

14 April 2008

Copyright © 2007-2008 Nortel Networks

.