fork download
  1. public class EnterExitLog {
  2.  
  3. protected Logger log_;
  4. protected Object source_;
  5. protected String fn_;
  6.  
  7. public EnterExitLog( Logger log, Object source, String fn )
  8. {
  9. log_ = log;
  10. source_ = source;
  11. fn_ = fn;
  12. LOG("ENTER " + fn_);
  13. }
  14.  
  15. public void LOG( String data )
  16. {
  17. // special log, no level needed
  18. // enable/disable in diag
  19. log_.logInfo(source_, data);
  20. }
  21.  
  22. @Override
  23. protected void finalize() throws Throwable
  24. {
  25. // perform last log
  26. LOG( "EXIT " + fn_);
  27. }
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class EnterExitLog is public, should be declared in a file named EnterExitLog.java
public class EnterExitLog {
       ^
Main.java:3: error: cannot find symbol
    protected Logger log_;
              ^
  symbol:   class Logger
  location: class EnterExitLog
Main.java:7: error: cannot find symbol
    public EnterExitLog( Logger log, Object source, String fn )
                         ^
  symbol:   class Logger
  location: class EnterExitLog
3 errors
stdout
Standard output is empty