Skip to content

Commit

Permalink
JBR-6276 Wayland: WLToolkit logs too much
Browse files Browse the repository at this point in the history
Changed the logging level for such messages to FINE
  • Loading branch information
mkartashev authored and jbrbot committed Nov 8, 2024
1 parent a36c960 commit e946179
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 129 deletions.
20 changes: 10 additions & 10 deletions src/java.desktop/unix/classes/sun/awt/wl/WLButtonPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public boolean isFocusable() {

@Override
public void setLabel(String label) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.setLabel(String)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLButtonPeer.setLabel(String)");
}
}

Expand All @@ -60,29 +60,29 @@ public void setBackground(Color c) {

public void focusGained(FocusEvent e) {
super.focusGained(e);
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.focusGained(FocusEvent)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLButtonPeer.focusGained(FocusEvent)");
}
}

public void focusLost(FocusEvent e) {
super.focusLost(e);
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.focusLost(FocusEvent)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLButtonPeer.focusLost(FocusEvent)");
}
}

@Override
void paintPeer(Graphics g) {
super.paintPeer(g);
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.paintPeer(Graphics)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLButtonPeer.paintPeer(Graphics)");
}
}

public Dimension getMinimumSize() {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLButtonPeer.getMinimumSize()");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLButtonPeer.getMinimumSize()");
}
return new Dimension(0, 0);
}
Expand Down
12 changes: 6 additions & 6 deletions src/java.desktop/unix/classes/sun/awt/wl/WLClipboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public WLClipboard(String name, boolean isPrimary) {

private static void dispatchDataOfferQueue() {
dispatchDataOfferQueueImpl(dataOfferQueuePtr); // does not return until error or server disconnect
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Clipboard: data offer dispatcher exited");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Clipboard: data offer dispatcher exited");
}
}

Expand Down Expand Up @@ -328,15 +328,15 @@ private void handleNewClipboard(long nativePtr) {
@Override
protected void registerClipboardViewerChecked() {
// TODO: is there any need to do more here?
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Unimplemented");
}
}

@Override
protected void unregisterClipboardViewerChecked() {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Unimplemented");
}
}

Expand Down
44 changes: 22 additions & 22 deletions src/java.desktop/unix/classes/sun/awt/wl/WLComponentPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ protected void wlSetVisible(boolean v) {
final int offsetY = offsetFromParent.y;

if (popupLog.isLoggable(PlatformLogger.Level.FINE)) {
popupLog.info("New popup: " + popup);
popupLog.info("\tparent:" + popupParent);
popupLog.info("\ttoplevel: " + toplevel);
popupLog.info("\toffset of anchor from toplevel: " + toplevelLocation);
popupLog.info("\toffset from anchor: " + offsetFromParent);
popupLog.fine("New popup: " + popup);
popupLog.fine("\tparent:" + popupParent);
popupLog.fine("\ttoplevel: " + toplevel);
popupLog.fine("\toffset of anchor from toplevel: " + toplevelLocation);
popupLog.fine("\toffset from anchor: " + offsetFromParent);
}

nativeCreateWLPopup(nativePtr,
Expand Down Expand Up @@ -335,8 +335,8 @@ public void setVisible(boolean v) {
* @see ComponentPeer
*/
public void setEnabled(final boolean value) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setEnabled(boolean)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.setEnabled(boolean)");
}
}

Expand Down Expand Up @@ -395,8 +395,8 @@ public Component getTarget() {
}

public void print(Graphics g) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.print(Graphics)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.print(Graphics)");
}
}

Expand Down Expand Up @@ -467,11 +467,11 @@ private void repositionWlPopup(int newX, int newY) {
final int parentX = toplevelLocation.x;
final int parentY = toplevelLocation.y;
if (popupLog.isLoggable(Level.FINE)) {
popupLog.info("Repositioning popup: " + popup);
popupLog.info("\tparent:" + popupParent);
popupLog.info("\ttoplevel: " + toplevel);
popupLog.info("\toffset of anchor from toplevel: " + toplevelLocation);
popupLog.info("\toffset from anchor: " + newX + ", " + newY);
popupLog.fine("Repositioning popup: " + popup);
popupLog.fine("\tparent:" + popupParent);
popupLog.fine("\ttoplevel: " + toplevel);
popupLog.fine("\toffset of anchor from toplevel: " + toplevelLocation);
popupLog.fine("\toffset from anchor: " + newX + ", " + newY);
}
nativeRepositionWLPopup(nativePtr, parentX, parentY, parentWidth, parentHeight,
thisWidth, thisHeight,
Expand Down Expand Up @@ -594,12 +594,12 @@ public void handleEvent(AWTEvent e) {
}
} else if (e instanceof KeyEvent && !((InputEvent) e).isConsumed()) {
// even if target is disabled.
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleF10JavaKeyEvent");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleF10JavaKeyEvent");
}
} else if (e instanceof InputMethodEvent) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleJavaInputMethodEvent");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.handleEvent(AWTEvent): handleJavaInputMethodEvent");
}
}

Expand Down Expand Up @@ -724,8 +724,8 @@ public void setForeground(Color c) {
log.fine("Set foreground to " + c);
}

if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setForeground(Color)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.setForeground(Color)");
}
}

Expand Down Expand Up @@ -859,8 +859,8 @@ public void destroyBuffers() {

@Override
public void setZOrder(ComponentPeer above) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Not implemented: WLComponentPeer.setZOrder(ComponentPeer)");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Not implemented: WLComponentPeer.setZOrder(ComponentPeer)");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileLis
@Override
protected String[] dragQueryFile(byte[] bytes) {
// TODO
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("Unimplemented");
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("Unimplemented");
}
return new String[0];
}
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/unix/classes/sun/awt/wl/WLFramePeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ void configureWLSurface() {

// @Override
// public void beginLayout() {
// log.info("Not implemented: WLFramePeer.beginLayout()");
// log.fine("Not implemented: WLFramePeer.beginLayout()");
// }
//
// @Override
// public void endLayout() {
// log.info("Not implemented: WLFramePeer.endLayout()");
// log.fine("Not implemented: WLFramePeer.endLayout()");
// }

@Override
Expand Down
Loading

0 comments on commit e946179

Please sign in to comment.