shueja / Monologue

21 stars 7 forks source link

[Feature] Enum logging #20

Open oh-yes-0-fps opened 8 months ago

oh-yes-0-fps commented 8 months ago

We could allow implicit logging of enum types through annotations, Logged classes and any other way we publish data.

There are 2 approaches:

Example of what it would look like in Logged


  public default <E extends Enum<?>> void log(String key, E value, LogLevel level) {
    Monologue.ntLogger.put(getFullPath() + "/" + key, value.name(), level);
  }
spacey-sooty commented 8 months ago

FWIW I think this would be a good addition logging enums is always a pain when you don't have a simple annotation based way to do it