libcamera: logging: add logging API for applications

Currently the log file and the log level can only be set via environment
variables, but applications may also want to set the log file and the
log level at run time. Provide an API for this.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Paul Elder
2019-07-11 18:30:07 +09:00
parent b50c5f28b1
commit 60f5d472d9
3 changed files with 83 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* logging.h - Logging infrastructure
*/
#ifndef __LIBCAMERA_LOGGING_H__
#define __LIBCAMERA_LOGGING_H__
namespace libcamera {
void logSetFile(const char *file);
int logSetLevel(const char *category, const char *level);
} /* namespace libcamera */
#endif /* __LIBCAMERA_LOGGING_H__ */