logenv.c 480 B

123456789101112131415161718192021222324
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Utility routines.
  4. *
  5. * Copyright (C) 2014 by Fugro Intersite B.V. <m.stam@fugro.nl>
  6. *
  7. * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  8. */
  9. #include "libbb.h"
  10. void FAST_FUNC bb_logenv_override(void)
  11. {
  12. const char* mode = getenv("LOGGING");
  13. if (!mode)
  14. return;
  15. if (strcmp(mode, "none") == 0)
  16. logmode = LOGMODE_NONE;
  17. #if ENABLE_FEATURE_SYSLOG
  18. else if (strcmp(mode, "syslog") == 0)
  19. logmode = LOGMODE_SYSLOG;
  20. #endif
  21. }