mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 12:47:48 +02:00
pass instance of std::ostream for logging from API
This commit is contained in:
parent
b7d1b74ffa
commit
bb05bcf39f
4 changed files with 39 additions and 18 deletions
|
@ -21,9 +21,12 @@ namespace api
|
|||
i2p::context.Init ();
|
||||
}
|
||||
|
||||
void StartI2P ()
|
||||
void StartI2P (std::ostream * logStream)
|
||||
{
|
||||
StartLog (i2p::util::filesystem::GetAppName () + ".log");
|
||||
if (logStream)
|
||||
StartLog (logStream);
|
||||
else
|
||||
StartLog (i2p::util::filesystem::GetAppName () + ".log");
|
||||
i2p::data::netdb.Start();
|
||||
LogPrint("NetDB started");
|
||||
i2p::transport::transports.Start();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define API_H__
|
||||
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include "Identity.h"
|
||||
#include "Destination.h"
|
||||
#include "Streaming.h"
|
||||
|
@ -12,7 +13,8 @@ namespace api
|
|||
{
|
||||
// initialization start and stop
|
||||
void InitI2P (int argc, char* argv[], const char * appName);
|
||||
void StartI2P ();
|
||||
void StartI2P (std::ostream * logStream = nullptr);
|
||||
// write system log to logStream, if not specified to <appName>.log in application's folder
|
||||
void StopI2P ();
|
||||
|
||||
// destinations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue