2016-05-03 16:31:17 +02:00
|
|
|
/*
|
|
|
|
* \brief Access to the core's log facility
|
|
|
|
* \author Norman Feske
|
2016-10-10 16:22:43 +02:00
|
|
|
* \author Stefan Kalkowski
|
2016-05-03 16:31:17 +02:00
|
|
|
* \date 2016-05-03
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2016-05-03 16:31:17 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2016-05-03 16:31:17 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/log.h>
|
|
|
|
|
|
|
|
/* base-internal includes */
|
|
|
|
#include <base/internal/globals.h>
|
|
|
|
#include <base/internal/output.h>
|
|
|
|
#include <base/internal/unmanaged_singleton.h>
|
|
|
|
|
2016-10-10 16:22:43 +02:00
|
|
|
/* core includes */
|
|
|
|
#include <core_log.h>
|
2016-05-03 16:31:17 +02:00
|
|
|
|
|
|
|
|
2016-12-01 11:58:50 +01:00
|
|
|
Genode::Log &Genode::Log::log()
|
2016-05-03 16:31:17 +02:00
|
|
|
{
|
2016-12-01 11:58:50 +01:00
|
|
|
struct Buffer
|
2016-10-10 16:22:43 +02:00
|
|
|
{
|
2016-12-01 11:58:50 +01:00
|
|
|
struct Write_fn : Core_log
|
2016-10-10 16:22:43 +02:00
|
|
|
{
|
2016-12-01 11:58:50 +01:00
|
|
|
void operator () (char const *s) { output(s); }
|
|
|
|
} function;
|
|
|
|
|
|
|
|
Buffered_output<512, Write_fn> buffer { function };
|
|
|
|
Log log { buffer };
|
2016-10-10 16:22:43 +02:00
|
|
|
};
|
2016-05-03 16:31:17 +02:00
|
|
|
|
2016-12-01 11:58:50 +01:00
|
|
|
return unmanaged_singleton<Buffer>()->log;
|
|
|
|
}
|
2016-05-03 16:31:17 +02:00
|
|
|
|
|
|
|
|
2016-12-01 11:58:50 +01:00
|
|
|
void Genode::init_log() { };
|