Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#404: logging concept #760

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7af9fc5
#765: Fix typos in DoD asciidoc
Oct 2, 2024
aeae1dd
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 17, 2024
e520d16
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 25, 2024
29403d3
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 25, 2024
5bff5eb
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 28, 2024
890c107
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 29, 2024
c55af62
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 31, 2024
5224bf9
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 7, 2024
d925977
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 8, 2024
8921a0c
Testprovider
KianRolf Nov 11, 2024
6a139b3
extension
KianRolf Nov 11, 2024
fcf4a64
draft pr
KianRolf Nov 13, 2024
e2b1c2b
fix
KianRolf Nov 13, 2024
648c65a
Merge branch 'main' into enhance/404-logging-concept
KianRolf Nov 13, 2024
22b59be
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Nov 14, 2024
5e1ce87
Merge branch 'main' into enhance/404-logging-concept
KianRolf Nov 14, 2024
a9ffba2
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Nov 18, 2024
c15e0d1
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Nov 19, 2024
dc5de78
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Nov 20, 2024
0ca3f64
Merge branch 'main' into enhance/404-logging-concept
hohwille Nov 28, 2024
26344ad
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Jan 21, 2025
76d3527
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Jan 21, 2025
fc74f71
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Jan 22, 2025
2fb8f0d
#404: implemented requested changes
jan-vcapgemini Jan 22, 2025
3a0616f
Merge branch 'main' into enhance/404-logging-concept
jan-vcapgemini Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/cli/Ideasy.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.devonfw.tools.ide.commandlet.ContextCommandlet;
import com.devonfw.tools.ide.context.AbstractIdeContext;
import com.devonfw.tools.ide.context.IdeContext;
Expand All @@ -19,6 +22,8 @@ public final class Ideasy {

private AbstractIdeContext context;

private static final Logger logger = LoggerFactory.getLogger(Ideasy.class);

/**
* The default constructor.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class IdeSubLoggerOut extends AbstractIdeSubLogger {
* @param out the {@link Appendable} to {@link Appendable#append(CharSequence) write} log messages to.
* @param colored - {@code true} for colored output according to {@link IdeLogLevel}, {@code false} otherwise.
* @param minLogLevel the minimum log level (threshold).
* @param listener the {@link IdeLogListener} to listen to.
*/
public IdeSubLoggerOut(IdeLogLevel level, Appendable out, boolean colored, IdeLogLevel minLogLevel, IdeLogListener listener) {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,338 @@
package com.devonfw.tools.ide.serviceprovider;

import org.slf4j.Logger;
import org.slf4j.Marker;

/**
* Implementation of {@link Logger}.
*/
public class IdeLoggerAdapter implements Logger {

private final String name;

/**
* The constructor.
*
* @param name of the logger.
*/
public IdeLoggerAdapter(String name) {

this.name = name;
}

@Override
public String getName() {

return name;
}

@Override
public boolean isTraceEnabled() {

return false;
}

@Override
public void trace(String s) {

}

@Override
public void trace(String s, Object o) {

}

@Override
public void trace(String s, Object o, Object o1) {

}

@Override
public void trace(String s, Object... objects) {

}

@Override
public void trace(String s, Throwable throwable) {

}

@Override
public boolean isTraceEnabled(Marker marker) {

return false;
}

@Override
public void trace(Marker marker, String s) {

}

@Override
public void trace(Marker marker, String s, Object o) {

}

@Override
public void trace(Marker marker, String s, Object o, Object o1) {

}

@Override
public void trace(Marker marker, String s, Object... objects) {

}

@Override
public void trace(Marker marker, String s, Throwable throwable) {

}

@Override
public boolean isDebugEnabled() {

return true;
}

@Override
public void debug(String s) {

}

@Override
public void debug(String s, Object o) {

}

@Override
public void debug(String s, Object o, Object o1) {

}

@Override
public void debug(String s, Object... objects) {

}

@Override
public void debug(String s, Throwable throwable) {

}

@Override
public boolean isDebugEnabled(Marker marker) {

return false;
}

@Override
public void debug(Marker marker, String s) {

}

@Override
public void debug(Marker marker, String s, Object o) {

}

@Override
public void debug(Marker marker, String s, Object o, Object o1) {

}

@Override
public void debug(Marker marker, String s, Object... objects) {

}

@Override
public void debug(Marker marker, String s, Throwable throwable) {

}

@Override
public boolean isInfoEnabled() {

return false;
}

@Override
public void info(String s) {

}

@Override
public void info(String s, Object o) {

}

@Override
public void info(String s, Object o, Object o1) {

}

@Override
public void info(String s, Object... objects) {

}

@Override
public void info(String s, Throwable throwable) {

}

@Override
public boolean isInfoEnabled(Marker marker) {

return false;
}

@Override
public void info(Marker marker, String s) {

}

@Override
public void info(Marker marker, String s, Object o) {

}

@Override
public void info(Marker marker, String s, Object o, Object o1) {

}

@Override
public void info(Marker marker, String s, Object... objects) {

}

@Override
public void info(Marker marker, String s, Throwable throwable) {

}

@Override
public boolean isWarnEnabled() {

return false;
}

@Override
public void warn(String s) {

}

@Override
public void warn(String s, Object o) {

}

@Override
public void warn(String s, Object... objects) {

}

@Override
public void warn(String s, Object o, Object o1) {

}

@Override
public void warn(String s, Throwable throwable) {

}

@Override
public boolean isWarnEnabled(Marker marker) {

return false;
}

@Override
public void warn(Marker marker, String s) {

}

@Override
public void warn(Marker marker, String s, Object o) {

}

@Override
public void warn(Marker marker, String s, Object o, Object o1) {

}

@Override
public void warn(Marker marker, String s, Object... objects) {

}

@Override
public void warn(Marker marker, String s, Throwable throwable) {

}

@Override
public boolean isErrorEnabled() {

return false;
}

@Override
public void error(String s) {

}

@Override
public void error(String s, Object o) {

}

@Override
public void error(String s, Object o, Object o1) {

}

@Override
public void error(String s, Object... objects) {

}

@Override
public void error(String s, Throwable throwable) {

}

@Override
public boolean isErrorEnabled(Marker marker) {

return false;
}

@Override
public void error(Marker marker, String s) {

}

@Override
public void error(Marker marker, String s, Object o) {

}

@Override
public void error(Marker marker, String s, Object o, Object o1) {

}

@Override
public void error(Marker marker, String s, Object... objects) {

}

@Override
public void error(Marker marker, String s, Throwable throwable) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.devonfw.tools.ide.serviceprovider;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

/**
* Implementation of {@link ILoggerFactory}.
*/
public class TestLoggerFactoryImpl implements ILoggerFactory {

@Override
public Logger getLogger(String name) {

return new IdeLoggerAdapter(name);
}
}
Loading
Loading