Commit Graph

47 Commits

Author SHA1 Message Date
Eugene Yokota f74e3e66f1 Trying to reproduce sbt/util#119 2017-08-24 17:51:50 -04:00
Dale Wijnand d31b9c5093
Add, configure & enable Scalafmt 2017-08-10 11:44:24 +01:00
Eugene Yokota 930489eba3 Fix ConsoleAppender to show full stack trace
This is modification of crash log event logging that was added in sbt/util#85.

Instead of using the hardcoded 0 as the default value, this introduces `setTrace(..)` to `ConsoleAppender` like `BasicLogger`. Also the default value is set to `Int.MaxValue` that will display the full stack trace.

Fixes sbt/sbt#3343
2017-07-26 00:03:07 -04:00
Eugene Yokota 5183f7ef81 Use event logging to send success
Fixes sbt/sbt#3213
2017-07-25 16:16:21 -04:00
Eugene Yokota d796084ff4 Filter out color in CosoleAppender only
Fixes sbt/sbt#3348
Ref #101

The new logger, based on log4j separates the concern of the log producer (Logger) and the handlers that takes actions (Appender, e.g for displaying on Console). As such filtering of color should be performed only in the ConsoleAppender.
2017-07-24 23:54:25 -04:00
Eugene Yokota f6370063f4 Deprecate ansiCodesSupported from the logger 2017-07-24 23:20:05 -04:00
Olli Helenius a38d3d6c69 Delegate ansiCodesSupported to ConsoleAppender
Fixes sbt/sbt#3336.
2017-07-18 19:57:57 +03:00
Martin Duhem ddcc909195 Re-fix ConsoleAppender
It turns out that calling `print` on `ConsoleOut` doesn't flush the
output. Remove `writeLine` and let `write` directly use `println`.
2017-07-17 14:36:03 +02:00
Dale Wijnand 81277cbf62 Merge pull request #99 from dwijnand/prereset
Add a RESET at the front of the appendLog line
2017-07-17 10:55:39 +01:00
Dale Wijnand e744985b6b
Add a RESET at the front of the appendLog line 2017-07-17 10:42:39 +01:00
Martin Duhem 28ab7ac79d
Fix logger printing too many newlines 2017-07-17 10:05:58 +02:00
eugene yokota 72f823c80b Merge pull request #91 from Duhemm/wip/cleanup-consoleappender
Cleanup `ConsoleAppender`
2017-07-15 13:17:02 -04:00
Eugene Yokota 8b5210f84d Bump to latest Contraband 2017-07-15 10:36:03 -04:00
eugene yokota 0e6e3a0a2c Merge branch '1.0' into wip/cleanup-consoleappender 2017-07-14 13:07:29 -04:00
jvican 18a73db57d
Remove unnecessary F0, F1 and Maybe
`F0`, `F1` and `Maybe` have become useless since Java 8 introduced
`Supplier`, `Function` and `Optional` in the default Java 8 standard
library.

Therefore, they are not necessary anymore. This change is required to
change some Zinc's and sbt APIs. They are not widely used, so the
changes will be small.
2017-07-14 15:56:34 +02:00
Eugene Yokota 19b3e47972 Fix casting error during initialization
While running scripted, you see

```
ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
 java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
	at java.lang.Class.cast(Class.java:3369)
	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
	at org.apache.logging.log4j.spi.ThreadContextMapFactory.createThreadContextMap(ThreadContextMapFactory.java:73)
	at org.apache.logging.log4j.ThreadContext.init(ThreadContext.java:223)
	at org.apache.logging.log4j.ThreadContext.<clinit>(ThreadContext.java:202)
	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
	at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:117)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:125)
	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
	at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:650)
	at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:487)
	at sbt.internal.util.ConsoleAppender.<init>(ConsoleAppender.scala:245)
```

This aims to workaround the casting error during PatternLayout.createDefaultLayout()
that was originally used for ConsoleAppender.
The stacktrace shows it's having issue initializing default DefaultConfiguration.
Since we currently do not use Layout inside ConsoleAppender, the actual pattern is not relevant.
2017-07-14 07:39:05 -04:00
Martin Duhem f55a509fdd
Cleanup `ConsoleAppender` 2017-07-11 16:08:58 +02:00
Dale Wijnand 84180ec402
Move Showlines to logging to drop logging->collection dep 2017-07-03 12:04:45 +01:00
Eugene Yokota 2d777a85ee clean up warnings 2017-07-01 07:47:39 -04:00
Eugene Yokota 4e01a35917 Contraband update 2017-07-01 07:47:19 -04:00
Eugene Yokota 32d6bf38cf send TraceEvent on crash
Fixes sbt/sbt#3234
2017-06-28 02:18:03 -04:00
Eugene Yokota f2cc5ee775 convert log4j async LogEvent to an immutable one
This fixes the buffered log not showing up for tests.

Ref sbt/sbt#3198
2017-05-18 00:36:24 -04:00
Eugene Yokota feeb6291cd Add toString for ObjectEvent 2017-05-18 00:34:41 -04:00
Dale Wijnand d088d16d78
Drop (out-X) from the log output
Fixes sbt/sbt#3056
2017-04-04 14:15:01 +01:00
Eugene Yokota 1dab826ffd Store JValue into ObjectEvent 2017-04-03 03:22:33 -04:00
Eugene Yokota e21c78ebb0 Move JValue format here 2017-04-03 03:22:04 -04:00
Eugene Yokota 94a2e6cb12 Fix directory name 2017-04-03 03:21:14 -04:00
Eugene Yokota a12045ed42 some change for Scala 2.10 2017-02-15 18:52:04 -05:00
Eugene Yokota a9377ce4a6 Implements registerStringCodec
Uses TypeTag to recover the full name of type parameter, which is calculated by StringTypeTag. This is sent along in ObjectEvent.
On the other end, we can lookup typeclass instances using the tag key.
2017-02-08 05:35:49 -05:00
Eugene Yokota 6e2f77f852 ProblemFormats 2017-01-25 23:25:24 -05:00
Eugene Yokota 1320c96953 Rename log events 2017-01-25 23:15:31 -05:00
Eugene Yokota f76e3aa2bb use java.util.Optional in Position 2017-01-25 20:58:37 -05:00
Eugene Yokota 51f9f91038 Adds BufferedAppender 2017-01-24 21:13:38 -05:00
Eugene Yokota 56b51df66b Avoid default params 2017-01-24 20:29:35 -05:00
Eugene Yokota 08e9ce9526 Implement basic event logging 2017-01-23 16:38:14 -05:00
Eugene Yokota ca6a0be602 Handle ReusableObjectMessage
When log4j2 is not using async logging, it sends the ObjectMessage using ReusableObjectMessage.
2017-01-18 06:54:15 -05:00
Eugene Yokota 36eeb4578d Reimplement multi-logger using log4j2
This introduces ManagedLogger, which is a wrapper around Log4j2's async logging.
Log4j2 separates the notion of logger (the code that collects events) and appender (the code that acts on events). The old code is kept around intentionally to minimize breakage during transition.
2017-01-13 02:49:12 -05:00
Dale Wijnand 033adfe4ea
Remove deprecated methods 2016-11-15 17:14:10 +00:00
Dale Wijnand 121e7f5d9e Add -Ywarn-unused & -Ywarn-unused-import, & fix warnings 2016-06-19 11:42:31 +01:00
Eugene Yokota 299484cee6 Remove some warnings 2016-04-01 15:27:37 -04:00
Eugene Yokota 277cbd12ef Adds concrete classes 2015-12-17 00:57:24 -05:00
Eugene Yokota 70b49e9a4b Comment on SI-8450 2015-09-07 01:45:39 -04:00
Eugene Yokota dc0fd2d48b move sbt.internal.util.Logger into sbt.util 2015-09-07 01:31:17 -04:00
Eugene Yokota 0a2d39673c sbt.util.internal -> sbt.internal.util package 2015-09-05 00:51:58 -04:00
Eugene Yokota bc54e035ef Move util into sbt.util.internal package 2015-09-04 12:54:38 -04:00
Martin Duhem 6175d92338 Add recommended compiler flags, fix most of the warnings 2015-08-31 15:25:10 +02:00
Eugene Yokota 871b4f4eef move modules around. 2015-08-20 00:59:57 -04:00