1/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15#ifndef TENSORFLOW_LITE_LOGGER_H_
16#define TENSORFLOW_LITE_LOGGER_H_
17
18namespace tflite {
19
20/// The severity level of a TFLite log message.
21/// WARNING: This is an experimental API and subject to change.
22enum LogSeverity {
23 /// Default log severity level.
24 TFLITE_LOG_VERBOSE = 0,
25 /// Log routine information.
26 TFLITE_LOG_INFO = 1,
27 /// Log warning events that might cause problems.
28 TFLITE_LOG_WARNING = 2,
29 /// Log error events that are likely to cause problems.
30 TFLITE_LOG_ERROR = 3,
31};
32
33/// TFLite logger specific configurations.
34/// WARNING: This is an experimental API and subject to change.
35class LoggerOptions {
36 public:
37 /// Get the minimum severity level for logging. Default is INFO in prod
38 /// builds and VERBOSE in debug builds.
39 /// Note: Default is always VERBOSE on Android.
40 /// WARNING: This is an experimental API and subject to change.
41 static LogSeverity GetMinimumLogSeverity();
42
43 /// Set the minimum severity level for logging, returning the old severity.
44 /// WARNING: This is an experimental API and subject to change.
45 static LogSeverity SetMinimumLogSeverity(LogSeverity new_severity);
46};
47
48} // namespace tflite
49
50#endif // TENSORFLOW_LITE_LOGGER_H_
51