Commit Graph

70 Commits

Author SHA1 Message Date
Liu Ming
cc0dc95de6 correct error summary category. 2016-10-20 20:58:04 +08:00
Atgeirr Flø Rasmussen
0283536ac4 Finish revision of logging. 2016-10-19 15:08:46 +02:00
Atgeirr Flø Rasmussen
35514c0aa0 Improve MessageLimiter class. 2016-10-19 13:11:13 +02:00
Atgeirr Flø Rasmussen
68311cf5b3 Merge branch 'messages-limits' of https://github.com/qilicun/opm-common into qilicun-messages-limits 2016-10-19 10:58:26 +02:00
Liu Ming
9020c7cb36 Support category limits setting. 2016-10-18 19:26:06 +08:00
Atgeirr Flø Rasmussen
3b22b584f3 Add OPM_THROW_NOLOG macro. 2016-10-17 13:02:50 +02:00
Atgeirr Flø Rasmussen
dd52371189 Merge pull request #175 from blattms/allow-quiet-EclipsePRTLog
Allow disabling output in EclipsePRTLog.
2016-09-26 09:18:15 +02:00
Markus Blatt
c0056ac4c8 Always initialize EclipsePRTLog::print_summary_ 2016-09-16 11:28:20 +02:00
Markus Blatt
644914ce5d Increase readability. 2016-09-16 09:57:20 +02:00
Markus Blatt
8eb2cead4d Document new stuff. 2016-09-16 09:50:19 +02:00
Markus Blatt
7da4e4a919 Resort to inherit StreamLog constructors in EclipsePRTLog.
That way we will never miss a constructor. Before this commit
some of them were actually missing.
2016-09-16 09:46:55 +02:00
Markus Blatt
64c0651ffa Allow disabling output in EclipsePRTLog.
In a parallel run we need to be able to disable output in EclipsePRTLog
as only one process is allowed to output messages. This commit adds a
new defaulted constructor parameter to allow this.
2016-09-15 21:22:21 +02:00
Atgeirr Flø Rasmussen
81a9f0521f Use map instead of unordered_map.
This is because downstream code can benefit from the ordering guarantee.
2016-09-07 13:37:09 +02:00
Liu Ming
8de9921890 file name and line number are in a new line. 2016-06-15 11:20:34 +08:00
Liu Ming
f9510e31a0 use the 'msg + file name + line number' format. 2016-06-13 13:46:51 +08:00
Atgeirr Flø Rasmussen
2102160bd1 Merge pull request #137 from qilicun/set-default-prefix
Make Error, Problem, Error, Warning with prefix by default.
2016-06-10 08:43:46 +02:00
Joakim Hove
405a6c31c5 Log: StreamLog can optionally open in append mode. 2016-06-09 18:52:40 +02:00
Liu Ming
213d4932a6 remove unused member data and fix initializing order. 2016-06-09 09:05:23 +02:00
Liu Ming
af9b0977f6 add two new constructors. 2016-06-08 15:30:52 +02:00
Liu Ming
752c8f3197 make Error, Warning, Bug, Problem with prefix by default. 2016-06-08 13:37:34 +02:00
Liu Ming
1a273ff6e3 make the first letter of prefix to be captial. 2016-06-08 13:35:05 +02:00
Liu Ming
b4c9f82585 Let Note has its own prefix. 2016-06-08 10:55:38 +02:00
Liu Ming
2dce26c9f0 fix indentation and order. 2016-06-08 10:52:23 +02:00
Liu Ming
83db625173 change the message type order. 2016-06-08 09:12:19 +02:00
Liu Ming
aa51ea67bc change Prtinfo to Note. 2016-06-08 09:00:24 +02:00
Liu Ming
3573ab0181 fix indentation. 2016-06-07 14:16:25 +02:00
Liu Ming
314a3ffec7 Add a new message type that allows messages only go into print file. 2016-06-07 14:08:33 +02:00
Liu Ming
908acdcb74 add yellow back and change warning color as blue. 2016-06-06 15:11:32 +02:00
Liu Ming
099099d87c change yellow to blue. 2016-06-06 14:56:29 +02:00
Liu Ming
9683fe2b95 Define one useful message type. 2016-06-06 11:52:57 +02:00
Atgeirr Flø Rasmussen
c4eb8936a8 No longer emit default Ansi color code for black.
Using no code for black makes it easier to read output with color in editors etc.
2016-05-25 13:56:33 +02:00
Magne Sjaastad
f77866bf68 Added Visual Studio guards and fixed missing include 2016-05-24 15:02:36 +02:00
Liu Ming
77a3df1a61 pass value not reference. 2016-05-23 15:01:28 +08:00
Liu Ming
367a9f9a0c Add default simple logging. 2016-05-23 10:12:29 +08:00
Atgeirr Flø Rasmussen
c4c1fe2b30 Rename methods according to code review. 2016-05-18 22:22:10 +02:00
Atgeirr Flø Rasmussen
f1a1aa02fb Simplify Logger methods. 2016-05-18 22:21:56 +02:00
Atgeirr Flø Rasmussen
d2564ff838 Support tagged messages.
This changes the design of the LogBackend class and its subclasses,
now the main virtual method is addTaggedMessage(). The former virtual
method addMessage() is now a regular non-virtual method forwarding to
addTaggedMessage().

You can configure message limiting based on tags by passing a MessageLimiter
to the configureMessageLimiter() method, which will then be used by the
includeMessage() method. That method now takes an additional tag argument.

The most user-visible part of this is that there are new overloads of the
static methods OpmLog::warning(), OpmLog::error() etc, that take message
tags. To tie things together the OpmLog and Logger classes have also gotten
new addTaggedMessage() methods, but they should mostly be used through the
convenience methods such as OpmLog::warning().
2016-05-18 13:27:12 +02:00
Atgeirr Flø Rasmussen
9c84967734 Add MessageLimiter class and test. 2016-05-18 12:11:26 +02:00
Atgeirr Flø Rasmussen
214e45e497 Use consistent member naming. 2016-05-18 09:27:53 +02:00
Atgeirr Flø Rasmussen
6be41d2fcf Added MessageFormatter. 2016-05-12 10:54:19 +02:00
Atgeirr Flø Rasmussen
474bc50519 Change clearBackends() -> removeAllBackends(). 2016-05-12 10:29:48 +02:00
Atgeirr Flø Rasmussen
2c10045195 Use constants for terminal codes. 2016-05-12 10:28:44 +02:00
Atgeirr Flø Rasmussen
56b6e45fc9 Add clearBackends() method to Logger and OpmLog singleton. 2016-05-09 11:33:35 +02:00
Atgeirr Flø Rasmussen
a896a4f792 Decorate from StreamLog, not OpmLog statics. 2016-05-09 11:32:42 +02:00
Atgeirr Flø Rasmussen
b40ea5dda7 Add configureDecoration() and decorateMessage() to LogBackend. 2016-05-09 11:30:13 +02:00
Atgeirr Flø Rasmussen
9a03758e9f Add Log::colorCodeMessage() helper. 2016-05-09 11:29:11 +02:00
Atgeirr Flø Rasmussen
de87c5a5b5 Make LogBackend pure virtual, also clean and document. 2016-05-09 10:42:28 +02:00
Atgeirr Flø Rasmussen
3e125643f5 Make OPM_THROW call OpmLog::error(). 2016-04-08 12:52:50 +02:00
Joakim Hove
116d741c89 Merge pull request #97 from atgeirr/experimental-pointerfiddling
Use reference pointers for fast field access.
2016-03-29 13:16:02 +02:00
Atgeirr Flø Rasmussen
52ce54bc47 Use reference pointers for fast field access.
This is necessary in the short term to replace SimulatorState with this
class without performance loss.
2016-03-29 09:44:50 +02:00