| 72 | } |
| 73 | |
| 74 | int PNode :: InitLogStorage(const Options & oOptions, LogStorage *& poLogStorage) |
| 75 | { |
| 76 | if (oOptions.poLogStorage != nullptr) |
| 77 | { |
| 78 | poLogStorage = oOptions.poLogStorage; |
| 79 | PLImp("OK, use user logstorage"); |
| 80 | return 0; |
| 81 | } |
| 82 | |
| 83 | if (oOptions.sLogStoragePath.size() == 0) |
| 84 | { |
| 85 | PLErr("LogStorage Path is null"); |
| 86 | return -2; |
| 87 | } |
| 88 | |
| 89 | int ret = m_oDefaultLogStorage.Init(oOptions.sLogStoragePath, oOptions.iGroupCount); |
| 90 | if (ret != 0) |
| 91 | { |
| 92 | PLErr("Init default logstorage fail, logpath %s ret %d", |
| 93 | oOptions.sLogStoragePath.c_str(), ret); |
| 94 | return ret; |
| 95 | } |
| 96 | |
| 97 | poLogStorage = &m_oDefaultLogStorage; |
| 98 | |
| 99 | PLImp("OK, use default logstorage"); |
| 100 | |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | int PNode :: InitNetWork(const Options & oOptions, NetWork *& poNetWork) |
| 105 | { |