* @param loglevel
   * @param message
   */
  public static void logMessage(String module, Stella_Object loglevel, Cons message) {
    if (Stella_Object.logLevelLE(loglevel, module)) {
      { OutputStream log = Stella.getLogStream(module);
        String moduleprefix = ((StringWrapper)(Stella.lookupLoggingParameter(module, Stella.KWD_PREFIX, StringWrapper.wrapString(module)))).wrapperValue;
        int maxroom = ((IntegerWrapper)(Stella.lookupLoggingParameter(module, Stella.KWD_MAX_WIDTH, IntegerWrapper.wrapInteger(10000)))).wrapperValue;
        int room = maxroom;
        String eltstring = null;

        try {
          log.nativeStream.print("[" + CalendarDate.makeCurrentDateTime().calendarDateToString(Stella.$LOGGING_LOCAL_TIME_ZONE$, false, false) + ((Stella.stringEqlP(moduleprefix, "") ? "" : " ")) + moduleprefix + "] ");
          { int i = Stella.NULL_INTEGER;
            int iter000 = 1;
            int upperBound000 = Stella.$LOG_INDENT_LEVEL$;
            boolean unboundedP000 = upperBound000 == Stella.NULL_INTEGER;

            for (;unboundedP000 ||
                      (iter000 <= upperBound000); iter000 = iter000 + 1) {
              i = iter000;
              i = i;
              log.nativeStream.print(" ");
            }
          }
          room = room - (27 + moduleprefix.length() + Stella.$LOG_INDENT_LEVEL$);
          { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

            try {
              Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
              { Stella_Object elt = null;
                Cons iter001 = message;

                loop001 : for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                  elt = iter001.value;
                  { Surrogate testValue000 = Stella_Object.safePrimaryType(elt);

                    if (Surrogate.subtypeOfStringP(testValue000)) {
                      { StringWrapper elt000 = ((StringWrapper)(elt));

                        eltstring = elt000.wrapperValue;
                      }
                    }
                    else if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_GENERALIZED_SYMBOL)) {
                      { GeneralizedSymbol elt000 = ((GeneralizedSymbol)(elt));

                        if (Stella.stringEqlP(elt000.symbolName, "EOL")) {
                          log.nativeStream.println();
                          room = maxroom;
                          continue loop001;
                        }
                        else {
                          eltstring = Native.stringify(elt000);
                        }
                      }
                    }
                    else {
                      eltstring = Native.stringify(elt);
                    }
                  }
                  if (room < eltstring.length()) {
                    log.nativeStream.print(Native.string_subsequence(eltstring, 0, room) + "...");
                  }
                  else {
                    log.nativeStream.print(eltstring);
                  }
                }
              }

            } finally {
              Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
            }
          }
          log.nativeStream.println();
          OutputStream.flushOutput(log);

        } finally {
        }
        if (Stella_Object.isaP(log, Stella.SGT_STELLA_FILE_OUTPUT_STREAM)) {
          Stream.closeStream(log);
        }
      }
    }
  }