diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-02 10:25:28 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-02 10:25:28 +0900 |
| commit | 315c05ea3c9abc693a1f704c0fba8bb74374ef59 (patch) | |
| tree | 271b533e72e4e33a6292c0b878e96fd6ed37bbe3 /src/aria2api.cc | |
| parent | f5d5d8fa8e0a77360c347837fa19206df9800f44 (diff) | |
Suppress console log output for library use, enclose Platform in try-catch
Still need to suppress global::cerr and global::cout
Diffstat (limited to 'src/aria2api.cc')
| -rw-r--r-- | src/aria2api.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/aria2api.cc b/src/aria2api.cc index d856d205..22963e83 100644 --- a/src/aria2api.cc +++ b/src/aria2api.cc @@ -72,7 +72,13 @@ Platform* platform = 0; int libraryInit() { - platform = new Platform(); + try { + platform = new Platform(); + } catch(RecoverableException& e) { + A2_LOG_ERROR_EX(EX_EXCEPTION_CAUGHT, e); + return -1; + } + LogFactory::setConsoleOutput(false); return 0; } |
