You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
965B

  1. /*
  2. * Copyright (c) 2016 The ZLToolKit project authors. All Rights Reserved.
  3. *
  4. * This file is part of ZLToolKit(https://github.com/ZLMediaKit/ZLToolKit).
  5. *
  6. * Use of this source code is governed by MIT license that can be found in the
  7. * LICENSE file in the root of the source tree. All contributing project authors
  8. * may be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "Util/logger.h"
  11. #include "Util/mini.h"
  12. using namespace toolkit;
  13. int main() {
  14. //设置日志
  15. Logger::Instance().add(std::make_shared<ConsoleChannel>());
  16. Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
  17. mINI ini;
  18. ini["a"] = "true";
  19. ini["b"] = "false";
  20. ini["c"] = "123";
  21. InfoL << ini["a"].as<bool>() << (bool) ini["a"];
  22. InfoL << ini["b"].as<bool>() << (bool) ini["b"];
  23. InfoL << ini["c"].as<int>() << (int) ini["c"];
  24. InfoL << (int)(ini["c"].as<uint8_t>()) << (int)((uint8_t) ini["c"]);
  25. return 0;
  26. }