Just return ok from sync().

Change-Id: I63d4bb6dac32edda758f38f475cbd7cc5ab1ecf9
Reviewed-on: http://review.couchbase.org/37515
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Fix formatting.

Change-Id: I0bd9d81d036a9603bffd04d26581f71c3f55a6c2
Reviewed-on: http://review.couchbase.org/37516
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Remove unneeded variable.

Change-Id: Iae066ef58f92c501c9a9c887606e11a927cd902e
Reviewed-on: http://review.couchbase.org/37517
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Abstract a function to get a logger implementation expression.

It handles atoms in compile time and falls back to run-time call to
ale_utils:logger_impl in other cases.

Change-Id: I6bd965fe562afee941fe6e7843f3dd1b8a199d5c
Reviewed-on: http://review.couchbase.org/37518
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Don't check logger expression for validity.

Essentially we just want to allow everything that is syntactically
correct Erlang.

Change-Id: Ie120c79d0155ff0a2ec927a6d8081b5bae0d48b5
Reviewed-on: http://review.couchbase.org/37519
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Simplify validity check for loglevel expression.

Reject only atoms that are not one of the known loglevels.

Change-Id: Iba5c6b20b2a98864e5aad1512568d7b5839aba54
Reviewed-on: http://review.couchbase.org/37520
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
(Pseudo-)Functions to inspect effective logger's loglevel.

ale:get_effective_loglevel(Logger)
  returns effective loglevel for a logger

ale:is_loglevel_enabled(Logger, LogLevel)
  returns true if Logger has LogLevel enabled

Change-Id: Ic9f0bd0e28d407c1652bc8471b72d415dc202d71
Reviewed-on: http://review.couchbase.org/37521
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Run transform on pseudo-functions' arguments.

Change-Id: Id0f11445dabcb32f1f34ec7ec52291d6262d65a5
Reviewed-on: http://review.couchbase.org/37522
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Define real functions for ale_transform pseudo-functions.

Change-Id: I4afae96a0daddf20352dc6352b038e838d98a18c
Reviewed-on: http://review.couchbase.org/37523
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Simplify handling of AST expressions' line numbers.

Use as few as possible.

Change-Id: I83d6c1cdd73947af79c3f7cad90ddfe268783fab
Reviewed-on: http://review.couchbase.org/37524
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Unify emit_logger_call and emit_dynamic_logger_call.

This allows got Logger in calls like ale:debug(Logger, ...) to be an
arbitrary expression (not just an atom).

Change-Id: Ib515732491acb9c8ccbe85342bdebfc50d2b05ae
Reviewed-on: http://review.couchbase.org/37525
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Document ale pseudo-functions.

Change-Id: I4a0e1a145f179315277b611dca6144711553f8e9
Reviewed-on: http://review.couchbase.org/37526
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Die on unexpected calls/casts/infos.

Change-Id: I8c59edac355f0122223645d37335066e611fbd42
Reviewed-on: http://review.couchbase.org/37743
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Make sink type part of sink module definition.

Change-Id: Iaa4ee6d43a585d2ab2295c4d4753669f4f60d64b
Reviewed-on: http://review.couchbase.org/37744
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reimplement disk sink without using disk_log.

Rotation is currently not supported. And sync can still block callers.

Change-Id: Ifa894debf30650a7daf95cdd4e963bf69b2f7b49
Reviewed-on: http://review.couchbase.org/37746
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Add size based rotation support to disk sink.

Change-Id: Ia8458611926ec5bf4b35ae002ef1549153fb6674
Reviewed-on: http://review.couchbase.org/37747
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Add optional log compression support.

Change-Id: Iba12f78fbf4a1331820a2cc69daa2ac234fd47bc
Reviewed-on: http://review.couchbase.org/37748
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Periodically check that we're writing to the same file.

This can be used to have external tools like logrotate handle log
rotation.

Change-Id: Ida82eac625b86b7fb09a28391234ea4290f46f12
Reviewed-on: http://review.couchbase.org/37749
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Perform blocking operations on a separate process.

Change-Id: I7bc05c81f726d5b8cf7a476f53e5bf5976552aa2
Reviewed-on: http://review.couchbase.org/37805
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Limit the amount of data that's being processed by worker.

And drop incoming messages on the floor if it's exceeded.

Change-Id: I33d744b3cf112244f756a8c6a01b565ad273b474
Reviewed-on: http://review.couchbase.org/37806
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>