from interface LogChute
6057
public void log (int level, String message, Throwable t)
    {
        if (isLevelEnabled(level)) {
            _sctx.log(message, t);
        }
    }
1184730
@Override
  public void emitted(Map<String, Object>log)  {
    if (socket == null) return;

    ByteArrayOutputStream messageBuffer = new ByteArrayOutputStream(1024);
    Writer messageWriter = null;
    try {
      messageWriter = new OutputStreamWriter(messageBuffer, "utf-8");
      JsonWriter jsonWriter = new JsonWriter(messageWriter);
      jsonWriter.write(log);
      messageWriter.write("\n");
    } catch (IOException e) {
      throw new InternalSpockError(e);
    } finally {
      IoUtil.closeQuietly(messageWriter);
    }

    ByteArrayOutputStream sizeBuffer = new ByteArrayOutputStream();
    Writer sizeWriter = null;
    try {
      sizeWriter = new OutputStreamWriter(sizeBuffer, "utf-8");
      sizeWriter.write(String.valueOf(messageBuffer.size()));
      sizeWriter.write("\n");
    } catch (IOException e) {
      throw new InternalSpockError(e);
    } finally {
      IoUtil.closeQuietly(sizeWriter);
    }

    try {
      socket.getOutputStream().write(sizeBuffer.toByteArray());
      socket.getOutputStream().write(messageBuffer.toByteArray());
      socket.getOutputStream().flush();
    } catch (Exception e) {
      IoUtil.closeQuietly(socket);
      socket = null;
      throw new ExtensionException("Error sending data to report server. " +
          "Server address: $reportServerAddress Server port: $reportServerPort", e);
    }
  }
354380
private void logInfo(@NonNull final Logger log) {
        log.i("App ver. = " + deviceDAO.device().getAppVer());
        log.i("Comapi device ID = " + deviceDAO.device().getDeviceId());
        log.d("Firebase ID = " + deviceDAO.device().getInstanceId());
    }
901461
public Any execute(DeviceImpl device, Any in_any) throws DevFailed
	{
		Util.out4.println("GetLoggingLevelCmd::execute(): arrived");
    
    String[] dvsa = null;
		try {
      dvsa = extract_DevVarStringArray(in_any);
		}
		catch (DevFailed df) {
			Util.out3.println("GetLoggingLevelCmd::execute() --> Wrong argument type");
			Except.re_throw_exception(df,
                                "API_IncompatibleCmdArgumentType",
                                "Imcompatible command argument type, expected type is : DevVarStringArray",
                                "GetLoggingLevelCmd.execute");
		}
    
    Any out_any = insert(Logging.instance().get_logging_level(dvsa));

		Util.out4.println("Leaving GetLoggingLevelCmd.execute()");	
    
    return out_any;
	}
1259375
public void logStackTrace (int level, String moduleName, Throwable t)
    {
        getLogger(moduleName).log(getLevel(level), "", t);
    }
1011425
function logtap(logger, message, data) {
  data = _.clone(data);
  if (data.payload_binary) {
    data.payload_binary = '... (' + data.payload_binary.length + ' bytes)';
  }
  logger.debug(message, data);
}
729054
private void logIfEnabled(Level level, Throwable throwable, String format, Object[] arguments){
		this.logIfEnabled(FQCN_SELF, level, throwable, format, arguments);
	}
217729
protected void setupLogFile() throws IOException {
        String filename = System.getProperty("java.io.tmpdir") + File.separator + "fxlauncher.log";
        if (getParameters().getNamed().containsKey("logfile"))
            filename = getParameters().getNamed().get("logfile");
        System.out.println("logging to " + filename);
        FileHandler handler = new FileHandler(filename);
        handler.setFormatter(new SimpleFormatter());
        log.addHandler(handler);
    }
165896
@Override
    @Trivial
    protected String getExecutionLogMessage(MessageType msgType) {

        LogHelper lh = new LogHelper();
        StringBuilder buf = lh.getBeginningPart(msgType);

        buf.append("invoking execution for a job");
        buf.append("\n JobInstance id = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getInstanceId());
        buf.append("\n JobExecution id = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getExecutionId());
        buf.append("\n Job Name = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getJobName());

        if (jobParameters != null) {
            buf.append("\n Job Parameters = ");
            buf.append(jobParameters);
        }

        if (!msgType.equals(MessageType.STARTED)) {
            buf.append("\n Job Batch Status = " + getBatchStatus());
            buf.append(", Job Exit Status = " + getExitStatus());
        }
        buf.append("\n" + LogHelper.dashes);
        return buf.toString();
    }
227287
private synchronized void logEvent( int level, String string, Throwable throwable )
    {
        // Check if the event should be logged
        if ( level > _loggingLevel )
        {
            return;
        }

        if ( _logFile != null )
        {
            // No logfile specified, log using servlet context
            PrintWriter pw = null;
            try
            {
                pw = new PrintWriter( new FileWriter( _logFile, true ) );
                pw.println( _servletName + "(" + level + "): " + string );
                if ( throwable != null )
                {
                    throwable.printStackTrace( pw );
                }
                pw.close();
                // Do a return here. An exception will cause a fall through to
                // do _servletContex logging API
                return;
            }
            catch ( IOException ioe )
            {
                /* just ignore */
            }
        }

        // Otherwise, write to servlet context log
        if ( throwable == null )
        {
            _servletContext.log( string );
        }
        else
        {
            _servletContext.log( string, throwable );
        }
    }
1176332
public static DiskInterface createLoggingProxy(final DiskInterface impl) {

        return (DiskInterface)Proxy.newProxyInstance(
            Thread.currentThread().getContextClassLoader(),
            new Class[] {DiskInterface.class},
            new InvocationHandler() {

                @SuppressWarnings("synthetic-access")
                public Object invoke(Object target, Method method, Object[] params) throws Throwable {

                    // Just to be on the safe side performance-wise, we only log the parameters/result
                    // if the info channel is enabled
                    if (LOG.isInfoEnabled()) {
                        List<String> paramStrings = new ArrayList<String>();
                        for (Object param : params) {
                            paramStrings.add("" + param);
                        }
                        String paramsAsString = CmsStringUtil.listAsString(paramStrings, ", ");
                        LOG.info("Call: " + method.getName() + " " + paramsAsString);
                    }
                    try {
                        Object result = method.invoke(impl, params);
                        if (LOG.isInfoEnabled()) {
                            LOG.info("Returned from " + method.getName() + ": " + result);
                        }
                        return result;
                    } catch (InvocationTargetException e) {
                        Throwable cause = e.getCause();
                        if ((cause != null) && (cause instanceof CmsSilentWrapperException)) {
                            // not really an error
                            LOG.info(cause.getCause().getLocalizedMessage(), cause.getCause());
                        } else {
                            LOG.error(e.getLocalizedMessage(), e);
                        }
                        throw e.getCause();
                    }
                }
            });
    }
110439
function (logInst) {

	var log_id = logInst.id;

	// create index to buffer map, if not exist
	if (l_logBufferIdxByID.hasOwnProperty(log_id) === false)
		l_logBufferIdxByID[log_id] = [];

	l_logBufferIdxByID[log_id].push(logInst);

	l_logBuffer.enqueue(logInst,

		// callback to write log
		function (tmpLog) {

			// show notice if queued log exceeds limit (once each time multiples of the limit is reached)
			if ((l_logBuffer.getLength() > 0) && (l_logBuffer.getLength() % l_logBufferOverloadLimit === 0)) {
				console.log(l_name + '::l_writeLog::' + SR.Tags.YELLOW + 'log len=' + l_logBuffer.getLength() + SR.Tags.ERREND);
			}

			// lock individual log instance            
			if (l_logs.hasOwnProperty(tmpLog.id) === true) {
				// if we're busy writing now, wait till next time
				if (l_logs[tmpLog.id].writing === true)
					return false;

				// lock the writing for this id
				l_logs[tmpLog.id].writing = true;

				SR.fs.writeSync(tmpLog.fd, tmpLog.msg, undefined, undefined);

				// remove a flag record from topmost
				if (l_logBufferIdxByID.hasOwnProperty(tmpLog.id) === true)
					l_logBufferIdxByID[tmpLog.id].shift();

				l_logs[tmpLog.id].writing = false;
			}

			// NOTE: processing will pause here if id doesn't exist in l_logs
			// TODO: right behavior?
			return true;
		}
	);
}
150324
public String logMessage(String strTrxID, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strContactType, String strPerson, String strMessageDescription, int iUserID, int iMessageReferenceID, Message message, String strDest)
    {
        Utility.getLogger().info("Sending message to URL: " + strDest);
        String strMessageFrom = null;
        String strMessageTo = null;
        String strContentType = null;
        String strContent = null;
        if (message != null)
        {
            try {
                Object objContent = message.getContent();
                strContentType = message.getContentType();
                Address[] rgstrMessageFrom = message.getFrom();
                if (rgstrMessageFrom != null) if (rgstrMessageFrom.length > 0)
                    strMessageFrom = rgstrMessageFrom[0].toString();
                Address[] rgstrMessageTo = message.getAllRecipients();
                if (rgstrMessageTo != null) if (rgstrMessageTo.length > 0)
                    strMessageTo = rgstrMessageTo[0].toString();
                if ((strMessageDescription == null) || (strMessageDescription.length() == 0))
                    strMessageDescription = message.getSubject();
                strContent = objContent.toString();
            } catch (IOException ex)    {
                ex.printStackTrace();
            } catch (MessagingException ex)    {
                ex.printStackTrace();
            }
        }
        // Be sure to call super!
        return super.logMessage(strTrxID, trxMessage, strMessageInfoType, strMessageProcessType, strMessageStatus, strMessageDescription, strContentType);
    }
277101
private void initComponents(String initialMessage, String initialUsername, LoginDialog loginDialog)
    {
    	this.loginDialog = loginDialog;
        java.awt.GridBagConstraints gridBagConstraints;

        getContentPane().setLayout(new java.awt.GridBagLayout());

        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        userMessage = new javax.swing.JLabel();
        userMessage.setText(initialMessage);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(userMessage, gridBagConstraints);

        userLabel = new javax.swing.JLabel();
        userLabel.setText("Email address");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(userLabel, gridBagConstraints);

        userField = new javax.swing.JTextField(20);
        userField.setText(initialUsername);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(userField, gridBagConstraints);

        passwordLabel = new javax.swing.JLabel();
        passwordLabel.setText("Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(passwordLabel, gridBagConstraints);
        
        passwordField = new javax.swing.JPasswordField(20);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(passwordField, gridBagConstraints);

        rePasswordLabel = new javax.swing.JLabel();
        rePasswordLabel.setText("Confirm password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(rePasswordLabel, gridBagConstraints);
        
        rePasswordField = new javax.swing.JPasswordField(20);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(rePasswordField, gridBagConstraints);

        saveInfoCheckbox = new javax.swing.JCheckBox();
        saveInfoCheckbox.setText("Remember me?");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(saveInfoCheckbox, gridBagConstraints);

        loginButton = new javax.swing.JButton();
        loginButton.setText("Submit");
        loginButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loginButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(loginButton, gridBagConstraints);
        getRootPane().setDefaultButton(loginButton);
        
        cancelButton = new javax.swing.JButton();
        cancelButton.setText("Cancel");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        getContentPane().add(cancelButton, gridBagConstraints);

        pack();
    }
380949
private void initXlog() {
    LogConfiguration config = new LogConfiguration.Builder()
        .logLevel(BuildConfig.DEBUG ? LogLevel.ALL             // Specify log level, logs below this level won't be printed, default: LogLevel.ALL
            : LogLevel.NONE)
        .tag(getString(R.string.global_tag))                   // Specify TAG, default: "X-LOG"
        // .t()                                                // Enable thread info, disabled by default
        // .st(2)                                              // Enable stack trace info with depth 2, disabled by default
        // .b()                                                // Enable border, disabled by default
        // .jsonFormatter(new MyJsonFormatter())               // Default: DefaultJsonFormatter
        // .xmlFormatter(new MyXmlFormatter())                 // Default: DefaultXmlFormatter
        // .throwableFormatter(new MyThrowableFormatter())     // Default: DefaultThrowableFormatter
        // .threadFormatter(new MyThreadFormatter())           // Default: DefaultThreadFormatter
        // .stackTraceFormatter(new MyStackTraceFormatter())   // Default: DefaultStackTraceFormatter
        // .borderFormatter(new MyBoardFormatter())            // Default: DefaultBorderFormatter
        // .addObjectFormatter(AnyClass.class,                 // Add formatter for specific class of object
        //     new AnyClassObjectFormatter())                  // Use Object.toString() by default
        .addInterceptor(new BlacklistTagsFilterInterceptor(    // Add blacklist tags filter
            "blacklist1", "blacklist2", "blacklist3"))
        // .addInterceptor(new WhitelistTagsFilterInterceptor( // Add whitelist tags filter
        //     "whitelist1", "whitelist2", "whitelist3"))
        // .addInterceptor(new MyInterceptor())                // Add a log interceptor
        .build();

    Printer androidPrinter = new AndroidPrinter();             // Printer that print the log using android.util.Log
    Printer filePrinter = new FilePrinter                      // Printer that print the log to the file system
        .Builder(new File(Environment.getExternalStorageDirectory(), "xlogsample").getPath())       // Specify the path to save log file
        .fileNameGenerator(new DateFileNameGenerator())        // Default: ChangelessFileNameGenerator("log")
        // .backupStrategy(new MyBackupStrategy())             // Default: FileSizeBackupStrategy(1024 * 1024)
        // .cleanStrategy(new FileLastModifiedCleanStrategy(MAX_TIME))     // Default: NeverCleanStrategy()
        .flattener(new ClassicFlattener())                     // Default: DefaultFlattener
        .build();

    XLog.init(                                                 // Initialize XLog
        config,                                                // Specify the log configuration, if not specified, will use new LogConfiguration.Builder().build()
        androidPrinter,                                        // Specify printers, if no printer is specified, AndroidPrinter(for Android)/ConsolePrinter(for java) will be used.
        filePrinter);

    // For future usage: partial usage in MainActivity.
    globalFilePrinter = filePrinter;
  }
884038
public void doPost(HttpServletRequest request,
                        HttpServletResponse response) 
        throws ServletException, IOException
    {
        String target=null;

        Log l = LogFactory.getLog(Debug.class);
        
        if (!(l instanceof LogImpl))
            return;
        LogImpl log = (LogImpl) l;
        String action=request.getParameter("Action");
        
        if ("Set Options".equals(action))
        {
            log.setDebug("on".equals(request.getParameter("D")));
            log.setSuppressWarnings("on".equals(request.getParameter("W")));
            String v=request.getParameter("V");
            if (v!=null && v.length()>0)
                log.setVerbose(Integer.parseInt(v));
            else
                log.setVerbose(0);
            log.setDebugPatterns(request.getParameter("P"));


            LogSink[] sinks = log.getLogSinks();
            for (int s=0;sinks!=null && s<sinks.length;s++)
            {
                if (sinks[s]==null)
                    continue;
                
                if ("on".equals(request.getParameter("LSS"+s)))
                {
                    if(!sinks[s].isStarted())
                        try{sinks[s].start();}catch(Exception e){log.warn(e);}
                }
                else
                {
                    if(sinks[s].isStarted())
                        try{sinks[s].stop();}catch(InterruptedException e){}
                }

                String options=request.getParameter("LO"+s);
                if (options==null)
                    options="";
                
                if (sinks[s] instanceof OutputStreamLogSink)
                {
                    OutputStreamLogSink sink=(OutputStreamLogSink)sinks[s];
                    
                    sink.setLogTags("on".equals(request.getParameter("LT"+s)));
                    sink.setLogLabels ("on".equals(request.getParameter("LL"+s)));
                    sink.setLogStackSize("on".equals(request.getParameter("Ls"+s)));
                    sink.setLogStackTrace("on".equals(request.getParameter("LS"+s)));
                    sink.setSuppressStack("on".equals(request.getParameter("SS"+s)));
                    sink.setLogOneLine("on".equals(request.getParameter("SL"+s)));

                    sink.setFilename(request.getParameter("LF"+s));
                }
                
            }
        }
        else if ("Add LogSink".equals(action))
        {
            System.err.println("add log sink "+request.getParameter("LSC"));
            try
            {
                log.add(request.getParameter("LSC"));
            }
            catch(Exception e)
            {
                log.warn(e);
            }
        }
        else if ("Delete Stopped Sinks".equals(action))
        {
            log.deleteStoppedLogSinks();
        }
        
        response.sendRedirect(request.getContextPath()+
                              request.getServletPath()+"/"+
                              Long.toString(System.currentTimeMillis(),36)+
                              (target!=null?("#"+target):""));
    }
360677
private Runnable createRunnableLoggingTask(final Level level,
            final Object message, final Throwable t) {
        // While logging, the logger thread temporarily disguises itself as its caller.
        final String callerThreadName = Thread.currentThread().getName();

        final Runnable runnableLoggingTask = new Runnable() {
            @Override
            public void run() {
                Thread loggerThread = Thread.currentThread();
                loggerThread.setName(callerThreadName);
                try {
                    m_logger.log(level, message, t);
                } catch (Throwable t) {
                    System.err.println("Exception thrown in logging thread for " +
                            callerThreadName + ":" + t);
                } finally {
                    loggerThread.setName(ASYNCH_LOGGER_THREAD_NAME);
                }
            }
        };
        return runnableLoggingTask;
    }