Java Date Format Pattern logFormat(String msg)

Here you can find the source of logFormat(String msg)

Description

log Format

License

Open Source License

Declaration

public static String logFormat(String msg) 

Method Source Code

//package com.java2s;
/*/*from ww w  .jav a2  s. c  o  m*/
 * Universal Media Server, for streaming any medias to DLNA
 * compatible renderers based on the http://www.ps3mediaserver.org.
 * Copyright (C) 2012  UMS developers.
 *
 * This program is a free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License only.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    public static String logFormat(String msg) {
        DateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm:ss");
        Date date = new Date();

        String[] messageDisplay = msg.replaceFirst("]",
                "string that should never match").split(
                "string that should never match");
        return dateFormat.format(date) + " " + messageDisplay[1];
    }
}

Related

  1. getStringAcordFormat()
  2. getSupportedFormats()
  3. isEqual(String d1, String d2, String format)
  4. isValidFormat(String format, String value)
  5. log(String format, Object... args)
  6. subFiles(String formatString, File[] files)
  7. subtraiHora(String horaFim, String horaIni, String formatoHora)
  8. sysdateStringddMMyyyyhhmmss()
  9. toThreadSafeFormat(final String format)