Pretty log an object. Its class name will be used as a description.

@param channels
the channels to pretty log to
@param obj
the object to be pretty logged
161161
public static void log(RedwoodChannels channels, Object obj) {
    log(channels, obj.getClass().getSimpleName(), obj);
  }
1064305
private static void log(RedwoodChannels channels, String description, Dictionary dict) {
    //(a real data structure)
    Map<Object, Object> map = new HashMap<Object, Object>();
    //(copy to map)
    Enumeration keys = dict.keys();
    while(keys.hasMoreElements()){
      Object key = keys.nextElement();
      Object value = dict.get(key);
      map.put(key,value);
    }
    //(log like normal)
    log(channels, description, map);
  }
648037
public void writeObject(Object obj, AbstractHessianOutput out) 
        throws IOException {
    	
        if (out.addRef(obj)) {
            return;
        }
	    
        Class< ? > cl = obj.getClass();
	    
        try {
            if (writeReplace != null) {
                Object repl = writeReplace.invoke(obj, new Object[0]);

                out.removeRef(obj);

                out.writeObject(repl);

                out.replaceRef(repl, obj);

                return;
            }
        } catch (Exception e) {
            log.log(Level.FINE, e.toString(), e);
        }

        int ref = out.writeObjectBegin(cl.getName());

        if (ref < -1) {
	    // Hessian 1.1 uses a map
	      
            for (int i = 0; i < localMethods.length; i++) {
                Object value = null;

                try {
                    value = localMethods[i].invoke(obj, (Object []) null);
                } catch (Exception e) {
                    log.log(Level.FINE, e.toString(), e);
                }
		
                if (!LazyUtil.isPropertyInitialized(value)) {
                    continue;
                }
		
                out.writeString(localNames[i]);
		
                out.writeObject(value);
            }
	      
            out.writeMapEnd();
        } else {
            if (ref == -1) {
                out.writeInt(localNames.length);
		
                for (int i = 0; i < localNames.length; i++) {
                    out.writeString(localNames[i]);
                }
                out.writeObjectBegin(cl.getName());
            }

            for (int i = 0; i < localMethods.length; i++) {
                Object value = null;

                try {
                    value = localMethods[i].invoke(obj, (Object []) null);
                } catch (Exception e) {
                    log.log(Level.FINER, e.toString(), e);
                }
		
                if (!LazyUtil.isPropertyInitialized(value)) {
                    continue;
                }
		
                out.writeObject(value);
            }
        }
    }
1312845
static void log(Object targetObj, String msg) {
        if (EventsParams.isDebug()) {
            Log.d(TAG, toLogStr(targetObj, msg));
        }
    }
186774
private static <T> void log(RedwoodChannels channels, String description, Iterable<T> iterable) {
    Redwood.startTrack(description);
    if (iterable == null) {
      channels.log("(iterable is null)");
    } else {
      int index = 0;
      for (T item : iterable) {
        if (dispatchable(item)) {
          log(channels, "Index " + index, item);
        } else {
          channels.logf("Index %d: %s", index, item);
        }
        index++;
      }

      if (index == 0) {
        channels.log("(empty)");
      }
    }
    Redwood.endTrack(description);
  }
436518
public <T> void write(final PrintWriter writer, final T object,
			final DataTypeDescriptor<T> descriptor, final boolean indent) {
		try {
			jsonFormat.write(writer, object, descriptor, indent);
		} catch (Exception e) {
			throw propagate(e);
		}
	}
1211648
@Override
	public void visitMethod(Method obj) {
		try {
			if (obj.isSynthetic()) {
				return;
			}

			if (Values.CONSTRUCTOR.equals(getMethodName()) && javaClass.getClassName().contains("$")) {
				return;
			}

			List<String> types = SignatureUtils.getParameterSignatures(obj.getSignature());
			if ((types.isEmpty()) || (types.size() > 2)) {
				return;
			}

			if ((obj.getAccessFlags() & Const.ACC_VARARGS) != 0) {
				return;
			}

			String lastParmSig = types.get(types.size() - 1);
			if (!lastParmSig.startsWith(Values.SIG_ARRAY_PREFIX)
					|| lastParmSig.startsWith(Values.SIG_ARRAY_OF_ARRAYS_PREFIX)) {
				return;
			}

			if (SignatureBuilder.SIG_BYTE_ARRAY.equals(lastParmSig)
					|| SignatureBuilder.SIG_CHAR_ARRAY.equals(lastParmSig)) {
				return;
			}

			if (hasSimilarParms(types)) {
				return;
			}

			if (obj.isStatic() && "main".equals(obj.getName()) && SIG_STRING_ARRAY_TO_VOID.equals(obj.getSignature())) {
				return;
			}

			if (!obj.isPrivate() && !obj.isStatic() && isInherited(obj)) {
				return;
			}

			super.visitMethod(obj);
			bugReporter.reportBug(new BugInstance(this, BugType.UVA_USE_VAR_ARGS.name(), LOW_PRIORITY).addClass(this)
					.addMethod(this));

		} catch (ClassNotFoundException cnfe) {
			bugReporter.reportMissingClass(cnfe);
		}
	}
593186
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        Method m = getMethod();
        if (Values.CONSTRUCTOR.equals(m.getName())) {
            for (String parmSig : SignatureUtils.getParameterSignatures(m.getSignature())) {
                if (SignatureUtils.classToSignature(SLF4J_LOGGER).equals(parmSig) || SignatureUtils.classToSignature(LOG4J_LOGGER).equals(parmSig)
                        || SignatureUtils.classToSignature(LOG4J2_LOGGER).equals(parmSig) || SignatureUtils.classToSignature(COMMONS_LOGGER).equals(parmSig)) {
                    bugReporter.reportBug(new BugInstance(this, BugType.LO_SUSPECT_LOG_PARAMETER.name(), NORMAL_PRIORITY).addClass(this).addMethod(this));
                }
            }
        }

        isStaticInitializer = Values.STATIC_INITIALIZER.equals(m.getName());
        super.visitCode(obj);
    }
951322
@Override
    public void debug(Object object, Object... objects) {
        if (isDebugEnabled()) {
            StringBuilder result = new StringBuilder();
            result.append(object.toString());
            for (Object obj : objects) {
                if (obj == null) {
                    result.append("null");
                } else {
                    result.append(obj.toString());
                }
            }
            debugString(result.toString());
        }
    }
219206
def debug_object(obj, log_level: int = logging.DEBUG) -> None:
    
    msgs = ["For {o!r}:".format(o=obj)]
    for attrname in dir(obj):
        attribute = getattr(obj, attrname)
        msgs.append("- {an!r}: {at!r}, of type {t!r}".format(
            an=attrname, at=attribute, t=type(attribute)))
    log.log(log_level, "{}", "\n".join(msgs))
626451
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();

        if (m.isSynthetic()) {
            return;
        }

        String signature = m.getSignature();
        if (!signature.endsWith(")Ljava/lang/Object;")) {
            return;
        }
        stack.resetForMethodEntry(this);
        returnTypes.clear();
        super.visitCode(obj);
        if (returnTypes.size() <= 1) {
            return;
        }
        String methodName = m.getName();
        try {
            boolean isInherited = SignatureUtils.isInheritedMethod(currentClass, methodName, signature);

            int priority = NORMAL_PRIORITY;
            for (JavaClass cls : returnTypes.keySet()) {
                if ((cls != null) && Values.DOTTED_JAVA_LANG_OBJECT.equals(cls.getClassName())) {
                    priority = LOW_PRIORITY;
                    break;
                }
            }

            JavaClass cls = findCommonType(returnTypes.keySet());
            BugInstance bug;
            if (isInherited) {
                bug = new BugInstance(this, BugType.URV_INHERITED_METHOD_WITH_RELATED_TYPES.name(), priority).addClass(this).addMethod(this);
                if (cls != null) {
                    bug.addString(cls.getClassName());
                }
            } else if (cls == null) {
                bug = new BugInstance(this, BugType.URV_UNRELATED_RETURN_VALUES.name(), priority).addClass(this).addMethod(this);
            } else {
                bug = new BugInstance(this, BugType.URV_CHANGE_RETURN_TYPE.name(), priority).addClass(this).addMethod(this);
                bug.addString(cls.getClassName());
            }
            for (Integer pc : returnTypes.values()) {
                bug.addSourceLine(this, pc.intValue());
            }
            bugReporter.reportBug(bug);
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
    }
506455
public final void print(Object obj) throws Exception {
        if ((mOutputOverridePermitted || mBuffer == null) 
            && mOutputReceiver != null) { 
            mOutputReceiver.print(obj);
        }
        else if (mBuffer != null) {
            mBuffer.append(toString(obj));
        }
    }
1327372
function(obj)
	{
	    var output = '';
	    
	    for (var i in obj)
	    {
	    	try
	    	{
			    if (obj[i] == null)
			    {
		            output += i + ' = [null]\n';
			    }
			    else if (typeof(obj[i]) == 'function')
			    {
		            output += i + ' => [Function]\n';
		        }
		        else if (typeof(obj[i]) == 'object')
		        {
		        	var ctor = mxUtils.getFunctionName(obj[i].constructor); 
		            output += i + ' => [' + ctor + ']\n';
		        }
		        else
		        {
		            output += i + ' = ' + obj[i] + '\n';
		        }
	    	}
	    	catch (e)
	    	{
	    		output += i + '=' + e.message;
	    	}
	    }
	    
	    return output;
	}
150089
public void debug(Object format, Object... msg) {
		if (logger.isDebugEnabled()) {
			// check if the first message contains variables variables
			if (format.toString().contains("{")) {
				logger.debug(format.toString(), msg);
			} else {
				logger.debug(format.toString().concat(" ").concat(JKStringUtil.concat(msg)));
			}
		}
	}
535416
public void colorChannel(String channel, Color color){
    if(this.channelColors == null){
      this.channelColors = new HashMap<String,Color>();
    }
    this.channelColors.put(channel.toLowerCase(),color);
  }
535273
@Override
    public void visitMethod(Method obj) {
        LocalVariableTable lvt = obj.getLocalVariableTable();
        if (lvt != null) {
            LocalVariable[] lvs = lvt.getLocalVariableTable();
            for (LocalVariable lv : lvs) {
                if (checkConfusedName(lv.getName(), lv.getSignature())) {
                    bugReporter.reportBug(new BugInstance(this, BugType.CNC_COLLECTION_NAMING_CONFUSION.name(), NORMAL_PRIORITY).addClass(this)
                            .addString(lv.getName()).addSourceLine(this.clsContext, this, lv.getStartPC()));
                }
            }
        }
    }
347180
@Override
    public void visitMethod(Method obj) {
        if (sawDateClass) {
            try {
                super.visitMethod(obj);
                currentMethod = obj;
                currentLockDataFlow = getClassContext().getLockDataflow(currentMethod);
                currentCFG = getClassContext().getCFG(currentMethod);
            } catch (CFGBuilderException e) {
                reporter.logError("Synchronization check in Static Calendar Detector caught an error.", e);
            } catch (DataflowAnalysisException e) {
                reporter.logError("Synchronization check in Static Calendar Detector caught an error.", e);
            }
        }
    }