Skip to content
Open
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/main/java/xbot/common/advantage/AKitLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public AKitLogger(IPropertySupport parent) {
this(parent.getPrefix());
}

public AKitLogger(Object object) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the situation you wanted this for? Should it instead ask for a string name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that it was more convenient to make AKitLoggers in situations where the object doesn't have a prefix, where we can just do new AKitLogger(this). However, thinking about it more, this is probably less necessary as the more explicit, already-existing version of new AKitLogger(this.getClass().getName()) also seems more reasonable, though for that one it's a longer line and you'll have to manually append a "/".

this(object.getClass().getName() + "/");
}

/**
* Temporarily changes the log level for this logger while running the provided code.
* This is useful for cases where you want to log something at a different level than the rest of the logger's logs.
Expand Down