annotate Resources/Samples/CppHelpers/Logging/OrthancLogger.cpp @ 3800:38b0f51781aa

improved error message when trying to execute a C-Find query that is not accepted by the remote modality
author Alain Mazy <alain@mazy.be>
date Wed, 01 Apr 2020 11:08:43 +0200
parents fbe22748cd9c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3460
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
1 #include "OrthancLogger.h"
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
2 #include "Logging.h"
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
3
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
4 namespace OrthancHelpers
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
5 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
6
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
7 void OrthancLogger::Trace(const char *message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
8 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
9 VLOG(1) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
10 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
11
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
12 void OrthancLogger::Trace(const std::string& message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
13 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
14 VLOG(1) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
15 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
16
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
17 void OrthancLogger::Info(const char *message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
18 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19 LOG(INFO) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
20 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
21
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
22 void OrthancLogger::Info(const std::string& message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
24 LOG(INFO) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
25 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
26
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
27 void OrthancLogger::Warning(const char *message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
28 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
29 LOG(WARNING) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
30 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
31
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
32 void OrthancLogger::Warning(const std::string& message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
33 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
34 LOG(WARNING) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
35 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
36
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
37 void OrthancLogger::Error(const char *message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
38 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
39 LOG(ERROR) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
40 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
41
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
42 void OrthancLogger::Error(const std::string& message)
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
43 {
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
44 LOG(ERROR) << GetContext() << " " << message;
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
45 }
fbe22748cd9c added logging OrthancHelpers
Alain Mazy <alain@mazy.be>
parents:
diff changeset
46 }