syslog: remove all fprintf calls and use syslog instead
Syslog is now used for all error messages, return values in the code should be used by programmers to see the status of the library/board and syslog can be used to see quickly from a debugging perspective what has gone wrong. A few cosmetics where improved as well as a mraa_set_log_level() call where the syslog log mask can be set directly from libmraa. Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -22,15 +22,22 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
//! [Interesting]
|
||||
#include "mraa.h"
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mraa_result_t ret;
|
||||
|
||||
ret = mraa_set_log_level(LOG_DEBUG);
|
||||
|
||||
fprintf(stdout, "hello mraa\n Version: %s\n", mraa_get_version());
|
||||
|
||||
mraa_deinit();
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
//! [Interesting]
|
||||
|
||||
Reference in New Issue
Block a user