Commit graph

7471 commits

Author SHA1 Message Date
H. S. Teoh
f723316320 Merge pull request #2724 from burner/rangeexception_front
Rangeexception
2015-01-26 13:28:29 -08:00
Михаил Страшун
9d54553410 Merge pull request #1500 from burner/logger
std.logger
2015-01-26 19:52:20 +02:00
Robert burner Schadek
5ee9d8724d unittest to make sure everything is set right 2015-01-26 18:10:55 +01:00
Andrei Alexandrescu
9a9d5f13e1 Merge pull request #2913 from burner/numeric_documentation_update
documentation update for numeric.d
2015-01-26 08:54:08 -08:00
Dicebot
197725e0ee Add a test case of thread-local logging 2015-01-26 18:21:03 +02:00
Robert burner Schadek
d250e5cc26 Revert "Remove concurrency @trusted workarounds"
This reverts commit 299f0183e2661cb2640749a692a3463a0e51c1f9.

thread local forward

thread local default log function forward

nicer imports

forwardMsg must not be final

moved comments to package and started to integerade Martin's log disabling

more compile time function disabling

style and dscanner suggestions

stdThreadLog fix and doc

a lot of updates

* spell fixes
* better tests
* docu changes

docu update

whitespace

moduleLogLevel docu
2015-01-26 16:09:48 +01:00
Robert burner Schadek
ced096ccf2 documentation update for numeric.d
* moved examples to unittests
* removed dead code
2015-01-26 15:08:49 +01:00
k-hara
3ee0dc79dd Remove pure attribute from the unittests which contain formatting floating point values
They were added by pull 2890 (ab9e15222a), but they were incorrectly accepted by the compiler regression.
2015-01-26 21:47:58 +09:00
Andrei Alexandrescu
b159a5bdc9 Merge pull request #2895 from quickfur/iota_bigint
Issue 6447 & 10762: support user-defined types in iota()
2015-01-26 01:27:00 -08:00
Andrei Alexandrescu
ab9e15222a Merge pull request #2890 from burner/format_documentation_update
documentation update for std.format.d
2015-01-26 00:55:18 -08:00
Andrei Alexandrescu
cb9969f3f3 Merge pull request #2892 from burner/math_documentation_update
std.math documentation update and @safe pure etc. unittests
2015-01-26 00:23:20 -08:00
Iain Buclaw
60cc9686da Merge pull request #2909 from yebblies/valistphobosagain
Revert "Merge pull request #2905 from 9rnsr/revert_pull2902"
2015-01-25 23:54:03 +00:00
Robert burner Schadek
a570d9e7bc handle rework
some little style fixup

some update at less verbose tests

not sure if that is my fault

some fixes

some more fixes

docu fixes

removed else branches by alias this

quickfur fixes
2015-01-25 22:32:06 +01:00
Robert burner Schadek
2b4fc3402e documentation update and @safe pure etc unittests
some more
2015-01-25 22:11:49 +01:00
Marc Schütz
27071a6c7f Add forgotten D to macro 2015-01-25 21:53:30 +01:00
Dicebot
8a77147276 Relax safety requirements on logging methods
Allows logging objects with @system toString
To compensate the change unittest blocks where marked as @safe where
applicable

Remove concurrency @trusted workarounds

Relevant druntime PR has been merged, plain @safe works now
2015-01-25 21:31:24 +01:00
Robert burner Schadek
bb1929b7b5 some more on multilogger
doc and style fixes mostly

rebase
2015-01-25 21:31:24 +01:00
Dicebot
e47421c878 Make std.concurrency constructors @safe
Fix safety of logger.core

Replaces @trusted abuse with @safe annotations and few occasional
@trusted tweaks.

Improve safety of all logger

Cleans usage of @safe and @trusted in derived modules
2015-01-25 21:31:24 +01:00
Robert burner Schadek
e0f29a68c0 MultiLogger rewrite
another doc update
2015-01-25 21:31:24 +01:00
Marco Leise
8b3631ed71 Made '__stdloggermutex' shared between threads, so it can fulfill its purpose.
Abstract methods have to be marked 'abstract', or the compiler wont complain about missing implementations, but instead assume they will be in some .o file that is later passed to the linker.

Made reads/writes to globalLogLevel atomic and separated global log level from stdlog's log level.

(Had to add a cast to the first array element of LogLevel arrays in foreach(). Possibly a compiler bug in 2.066 master.)

Avoid races with reading/writing the standard Logger:
 * User code can no longer directly read out the stdlog, because by the time it has the reference, it might already be obsolete. (Later an `opApply` style function could be provided to execute functions/delegates in the context of a locked stdlog.)
 * The stdlog property was split up into a public setter `stdlog` and a package getter `stdlogImpl`, because the compiler doesn't like different visibility for getter and setter.
 * All module level functions dealing with the stdlog now synchronize with the global `__stdloggermutex`.

static assert(__ctfe) doesn't do what one might expect. Code is always generated and emitted for `isLoggingActive` and it can be called at runtime. This commit turns the template function into just a template `isLoggingActiveAt` and a global bool flag `isLoggingActive`, so they can both be evaluated without parenthesis now and don't end up as functions in the final executable.

Fix: Unittesting symbols like randomString() are visible outside of the logger package.

Changed Logger methods to `final`, that are not documented as overridable to gain more control over the implementation details when I implement thread safety measures.
Made `fatalHandler` accessible as a property to allow synchronization in later commits.
Also made `writeLogMsg` protected, so it can assume it is properly synchronized already by the public calls calling it.
To log a pre-built message `forwardMsg` can now be used. (See `FileLogger`).

Fixed my mistake, where setting `stdlog` before querying `stdlogImpl` would revert the setting. And while I was at it, I changed `stdlog`s behavoir on assignment of `null`: It will now put the default logger back in place.

First attempt on making logging thread safe: Logger now has a mutex to protect its public API.
The module level functions don't perform any runtime checks themselves to avoid races.
Instead the logger does all checking under protection of its mutex.
`globalLogLevel` will be evaluated only once for any public logging call and thus needs no global locking.
All overrides of `writeLogMsg`, `beginLogMsg`, `logMsgPart` and `finishLogMsg` have `protected` visibility now, since they expect their logger to be already under mutex protection and must not be publically visible.

Fixed `MultiLogger` to not perform checks for its children to avoid races.

Small fix for `StdLoggerDisableLogging`.

some more unittests and some fixes

doc fixes

doc fix MrSmith33

Array problem

stupid me

stupid me

The getter for Logger.logLevel now uses an `atomicLoad` instead of full mutex lock.
Read-access to `stdlog` is now back...

Fixed inverted DDoc meaning for `isLoggingActive`.

Removed synchronization with a global lock for the duration of any standard logging call in an exchange of sequential consinstency for throughput.

Rejects valid: logf(LogLevel.fatal, "I am %s", true);
(The template constraint is not required in this case.)

Fix for `template isLoggingActive` that would break if an actual log level was disabled.
2015-01-25 21:31:23 +01:00
Robert burner Schadek
04aa499ce0 std.logger
some more docu fixes

fatel -> fatal

changed the way of calling

some rework

some better comments and win32.mak fix

more documentation

trying to figure out why win32 fails

test before you commit

another try to work around windows files and processes

maybe this time

maybe this merges

update 1 mostly soenke

MultiLogger and Logger have names

more docu

unittest fix

some better comments and win32.mak fix

Conflicts:
	std/logger.d

antoher doc fix

less code dup and more log functions

docs are now generated

some more fixing

speedup

some threading

forgot some

better docu gen and more testing

two new LogLevel, most functions are now at least @trusted

Tracer functionality

fatal delegate

some phobos style fixes

another bug bites the dust

version disable enhancements

default global LogLevel set to LogLevel.all

logLevel compare bugfix

delete of dead code

tab to whitespace

bugfixes, reduandency removal, and docu

multilogger was logging to all it childs without checking there LogLevel in
relation to the LogLevel of the LoggerPayload.

Some constructors where redundant.

more examples and more documentation

some fixes

NullLogger and moduleName

wrong doc

I splitted the multi logger implementations out

loglevelF to loglevelf in order to make phobos style think writefln

document building

win makefile fixes

some optimizations thanks to @elendel-
some whitespace

some updates from the github logger project

* stdio- and filelogger now use a templatelogger base to reduce code

makefile fixes

makefile

fixed the unittest

made sure the stdiologger is set up at the end

some comment fixes

finding the filelogger segfault

closed another file

a lookup fix

darwin unittest fail output

more diagnostics

* more documentation for the templatelogger and multilogger
* it breaks the log function api
 * log and logf now behave as their write and writef counterparts
 * for logging with an explicit LogLevel call logl loglf
 * for logging with an explicit condition call logc logcf
 * for logging with an explicit LogLevel and explicit condition call
 * loglc loglcf
 * the log function with an explicit LogLevel like info, warning, ...
 * can be extended into c, f or cf and therefore require a condition
 * and/or are printf functions

something is still interesting

rebase and lazy Args

saver file handling

whitespace

some updates

tracer is gone and more doc updates

codegen rework to allow log function comments

thread safe and concur works comments for free standing log functions

fixes #10

* free log function doco
* StdIOLogger prints now threadsafe
* concurrentcy hang fix

more docu

old file

even more doc

typo

* more better doc
* makefile fix

another fix

more unittests nearl 100% everywhere

another test

no more mixins more doc

win64 please pass

fixes from the review and voting

hope this fixes it

more comments

more docs more tests

more docu

more doc and fixes from jacob-carlborg

LogEntry.logger reference

more fixes

fileptr is gone

logger move to experimental/logger

type in win32/64 makefile

win makefile

nogc and threading

makefile fixes

some log calls take line and file as parameter
2015-01-25 21:30:47 +01:00
Daniel Murphy
4c737a672f Revert "Merge pull request #2905 from 9rnsr/revert_pull2902"
This reverts commit 80f463a1e2, reversing
changes made to 588c76c19b.
2015-01-26 04:42:37 +11:00
k-hara
a6f330c030 Use debug instead of version 2015-01-25 20:21:45 +09:00
Andrei Alexandrescu
3fbb2c33dd Merge pull request #2864 from e10s/patch-6
Fix Issue 13963 - BigInt modulo ulong is rejected
2015-01-24 19:42:19 -08:00
Andrei Alexandrescu
1081d053c5 Merge pull request #2888 from burner/encoding_documentation_update
encoding.d documentation update
2015-01-24 18:28:20 -08:00
k-hara
5417836f10 Revert "Merge pull request #2902 from yebblies/typeofva_argsave"
This reverts commit f07a77d106, reversing
changes made to 4bd949406a.

It's breaking std.outbuffer unittest in Win64 platform.
2015-01-25 06:47:08 +09:00
Robert burner Schadek
e21a35fd01 documentation update for std.format.d
* to much to name it all

alot more examples

back to undocumented + marked for deprecation
2015-01-24 22:01:19 +01:00
H. S. Teoh
58bbd1984a Don't assume B.init is an lvalue. 2015-01-24 12:15:27 -08:00
Andrei Alexandrescu
588c76c19b Merge pull request #2854 from quickfur/bitarray_init
Issue 13806: BitArray should not define member function called init()
2015-01-24 12:01:01 -08:00
Andrei Alexandrescu
224ab42e0c Merge pull request #2874 from MartinNowak/addMessageFreeList
use lock-free freelist
2015-01-24 12:00:19 -08:00
Andrei Alexandrescu
a5b1f5bcaa Merge pull request #2901 from rainers/issue14025
fix Issue 14025 - unittests for memoize fail intermittently
2015-01-24 09:55:05 -08:00
Andrei Alexandrescu
f07a77d106 Merge pull request #2902 from yebblies/typeofva_argsave
Use presence of __va_argsave to determine if __va_argsave hack is needed
2015-01-24 09:54:21 -08:00
Ferdinand Majerech
33261628ea Mentioning that a container is not a range. 2015-01-24 17:08:33 +01:00
Ferdinand Majerech
60f87c0f26 Mention that invalid process IDs are negative. 2015-01-24 16:50:11 +01:00
Daniel Murphy
c19ceb8506 Use presence of __va_argsave to determine if __va_argsave hack is needed 2015-01-25 01:34:32 +11:00
Rainer Schuetze
e661e59194 do not assume memoize cache initialized before the arguments and the result are actually written 2015-01-24 10:08:47 +01:00
H. S. Teoh
72ee9e6992 Merge pull request #2893 from AndyColson/std-json-doc
Documentation code samples for std.json
2015-01-23 22:57:03 -08:00
H. S. Teoh
f1e18242c5 Merge pull request #2884 from burner/bigint_doc_update
documentation update for bigint.d
2015-01-23 14:52:02 -08:00
H. S. Teoh
810779c9c4 Fallback to !=/== if < is not available. 2015-01-23 14:48:12 -08:00
Andrei Alexandrescu
58be104aa0 Merge pull request #2899 from quickfur/aggregate
Implement aggregate().
2015-01-23 13:18:22 -08:00
Andrei Alexandrescu
ed3776a8c7 Merge pull request #2898 from quickfur/topNIndex
Move topNIndex to std.algorithm.sorting.
2015-01-23 12:16:43 -08:00
H. S. Teoh
0623b98822 Update navigational links. 2015-01-23 11:52:54 -08:00
H. S. Teoh
ab1d304dca Implement aggregate(). 2015-01-23 11:52:54 -08:00
H. S. Teoh
0520fba4f6 Delete evil tab characters that somehow slipped in. 2015-01-23 11:11:47 -08:00
H. S. Teoh
13149ded17 Update navigation links and cheatsheet. 2015-01-23 11:05:19 -08:00
Andrei Alexandrescu
0ffae6824f Merge pull request #2878 from quickfur/new_groupBy
New implementation of groupBy
2015-01-23 09:49:59 -08:00
H. S. Teoh
dfd1c2338f Fixups based on feedback. 2015-01-23 09:01:41 -08:00
Andy Colson
f5b01e66ea ddoc'd unittest 2015-01-22 20:40:08 -06:00
H. S. Teoh
f8be0070d7 Bail out if user asks for unimplemented swap strategy. 2015-01-22 14:53:30 -08:00
H. S. Teoh
6347527fc2 Move topNIndex to std.algorithm.sorting.
Improve documentation and add missing sig constraints.
2015-01-22 13:43:57 -08:00