Commit graph

25 commits

Author SHA1 Message Date
Sönke Ludwig 9980eae7a5 Fix intermittent unit test crash at shutdown.
Sometimes crashed on macos when the logger instance was reaped at runtime shutdown time.
2021-01-12 10:55:12 +01:00
Sönke Ludwig 3fbc8bb397 Fix deprecation warning. 2021-01-12 10:55:12 +01:00
Geod24 bd8c2c6e90 Use logException consistently and use logDiagnostic
Many places around were re-inventing logException with varying level of success.
In addition, the full error is now printed as a diagnostic instead of debug.
This is more in line with the description of `LogLevel.diagnostic`
("Extended user information (e.g. for more detailed error information)"),
as opposed to the one of `LogLevel.debug_`
("Developer information useful for algorithm debugging").
2020-08-24 05:17:59 +02:00
Geod24 f3accb40d5 Replace compile-time logging arguments file / line with runtime one
Since DMD v2.079.0 it is possible to put default, always-used default parameters
after variadic arguments (as long as IFTI is used).
This way we can move all the compile-time arguments, which would always trigger
a template instantiation, to runtime arguments, and re-enable module and function.
2020-08-24 05:17:59 +02:00
Sönke Ludwig 899a84d834 Fix SyslogLogger. Fixes #203.
This was not working at all since the release of vibe-core due to dependencies on other parts of vibe.d. The unit test has now been moved out of the template class, so that it is actually run.
2020-04-10 18:13:35 +02:00
Sönke Ludwig 8e24c4a204 Correct copyright holder.
rejectedsoftware e.K. doesn't exist anymore since mid-2019.
2020-01-27 19:20:52 +01:00
Sönke Ludwig 08db20629b Implement logException.
Logs an exception along with an error message and the full stack trace. Performs proper exception handling for the latter to stay nothrow.
2019-05-25 22:12:43 +02:00
Denis Feklushkin fc9bef86af Logger: avoid formatting for strings without additional args 2019-04-23 23:01:44 +07:00
Sönke Ludwig aca672416c Fix host name conversion code for SyslogLogger.
See vibe-d/vibe.d#2220
2018-11-07 09:41:57 +01:00
Anton Fediushin 7514f1183e Fix logger colours to make it look good on black and white background 2018-06-09 15:54:24 +02:00
Sebastian Wilzbach 6107c1d807 Replace deprecated hexstring with hexString 2018-01-25 08:43:13 +01:00
Sönke Ludwig 9e0b5a7821 Fix access violation in the log module when called from a non-D thread. 2017-09-21 14:09:19 +02:00
Sönke Ludwig 43260cf982
Log the fiber/task ID in the HTML logger. 2017-09-03 14:17:57 +02:00
Sebastian Wilzbach 8f89733a86 Remove all trailing whitespace
sed 's/[ \t]*$//' -i **/*.d
2017-07-03 12:19:27 +02:00
Sönke Ludwig ed9efd9f44 Merge pull request #10 from wilzbach/allow-removal-of-the-default-logger
Allow removal of the default logger
2017-06-22 10:25:20 +02:00
Sönke Ludwig e769a9b1ca Avoid lazy evaluation of log arguments while the loggers are locked. Fixes rejectedsoftware/vibe.d#1717.
The deadlock happened because a function that waits for a worker task to finish was passed to the log functions. Evaluated lazily, it got called while the logger's mutex was locked, meaning that any log call from within that thread would cause a deadlock.

This change also has another, possibly important, implication - arguments are evaluated only once instead of possibly multiple times if multiple loggers are registered. This could very well make a lot of existing (wrong) code more robust (e.g. logInfo("%s", i++)).
2017-03-23 17:55:51 +01:00
Sebastian Wilzbach c80a15321e Allow removal of the default logger 2017-03-22 13:45:32 +01:00
Sönke Ludwig 6f26766c70 Fix the "threadTime" log format to be consistent with "thread". 2017-02-22 17:36:43 +01:00
Sönke Ludwig 93b342bf77 Fix compilation error on Windows. 2017-02-16 10:20:21 +01:00
Sönke Ludwig da2dfa23df Only emit color escape sequences on a Posix terminal. 2016-12-19 21:22:22 +01:00
Sönke Ludwig 2071f30a1c Remove public HTML escaping declarations from log module. 2016-11-02 20:24:41 +01:00
Sönke Ludwig 6bf63c7331 Add optional terminal color support and make the task/thread prefix more concise. 2016-06-17 22:34:50 +02:00
Sönke Ludwig 3b0e4e0452 Big refactoring step.
- Moves a lot of stuff from vibe.core.core to vibe.core.task
- Introduces TaskScheduler to unify the scheduling process
- Refines how tasks are scheduled and processed (can push to the front of the task queue and uses a marker task to keep track of the spot up to which to process)
- Start to add proper support for task interrupts and timeouts by properly cancelling in-flight async operations
- Work on ManualEvent - still not functional for the shared case
- Implement proper IP address parsing in NetworkAddress
2016-06-14 08:01:03 +02:00
Martin Nowak dc9002de0e make splitting of log lines configurable
- it might make sense to have newlines in a log message
  (e.g. when printing a backtrace) and they shouldn't
  be split into multiple log messages, e.g. when using syslog
- the splitting was fixed to work with more than one LF

(cherry picked from commit d14ce3dea1b98227dcd116acc6b175c56d9a1fb0)
2016-04-10 14:40:38 +02:00
Sönke Ludwig 7e2d1dd038 Initial commit.
The library is able to support simple TCP servers in the current state. The API is still mostly compatible with mainline vibe.d, but the driver systen has been replaced by the eventcore library and sockets/files/timers/... are now structs with automatic reference counting instead of GC collected classes. The stream interfaces have been removed for now.
2016-03-01 20:30:42 +01:00