libcamera: Add initial logger

The logger is based on the ostream API, allowing code to log messages in
a native way. It automatically logs the time stamp, severity level, file
name and line number.

Many important features are missing, such as logging to file, logging
classes, and log filtering based on the severity level, file name and
class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2018-12-04 23:52:34 +02:00
parent 913b3ee817
commit edbd2059d8
5 changed files with 135 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2018, Google Inc.
*
* utils.h - Miscellaneous utility functions
*/
#ifndef __LIBCAMERA_UTILS_H__
#define __LIBCAMERA_UTILS_H__
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#endif /* __LIBCAMERA_UTILS_H__ */