Mercurial > hg > orthanc
annotate OrthancServer/Resources/Samples/CppHelpers/Logging/OrthancPluginLogger.cpp @ 5853:4d932683049d get-scu tip
very first implementation of C-Get SCU
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 29 Oct 2024 17:25:49 +0100 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
4829
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
1 /** |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4829
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
8 * |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 * This program is free software: you can redistribute it and/or |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 * modify it under the terms of the GNU General Public License as |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
11 * published by the Free Software Foundation, either version 3 of the |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
12 * License, or (at your option) any later version. |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
13 * |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, but |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 * General Public License for more details. |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 * |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 * You should have received a copy of the GNU General Public License |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
21 **/ |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
22 |
c847b0dfd255
added missing copyright headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
23 |
3460 | 24 #include "OrthancPluginLogger.h" |
25 | |
26 namespace OrthancHelpers | |
27 { | |
28 | |
29 OrthancPluginLogger::OrthancPluginLogger(OrthancPluginContext *context) | |
30 : pluginContext_(context), | |
31 hasAlreadyLoggedTraceWarning_(false) | |
32 { | |
33 } | |
34 | |
35 void OrthancPluginLogger::Trace(const char *message) | |
36 { | |
37 Trace(std::string(message)); | |
38 } | |
39 | |
40 void OrthancPluginLogger::Trace(const std::string &message) | |
41 { | |
42 if (!hasAlreadyLoggedTraceWarning_) | |
43 { | |
44 Warning("Trying to log 'TRACE' level information in a plugin is not possible. These logs won't appear."); | |
45 hasAlreadyLoggedTraceWarning_ = true; | |
46 } | |
47 } | |
48 | |
49 void OrthancPluginLogger::Info(const char *message) | |
50 { | |
51 Info(std::string(message)); | |
52 } | |
53 | |
54 void OrthancPluginLogger::Info(const std::string &message) | |
55 { | |
56 OrthancPluginLogInfo(pluginContext_, (GetContext() + " " + message).c_str()); | |
57 } | |
58 | |
59 void OrthancPluginLogger::Warning(const char *message) | |
60 { | |
61 Warning(std::string(message)); | |
62 } | |
63 | |
64 void OrthancPluginLogger::Warning(const std::string &message) | |
65 { | |
66 OrthancPluginLogWarning(pluginContext_, (GetContext() + " " + message).c_str()); | |
67 } | |
68 | |
69 void OrthancPluginLogger::Error(const char *message) | |
70 { | |
71 Error(std::string(message)); | |
72 } | |
73 | |
74 void OrthancPluginLogger::Error(const std::string &message) | |
75 { | |
76 OrthancPluginLogError(pluginContext_, (GetContext() + " " + message).c_str()); | |
77 } | |
78 } // namespace OrthancHelpers |