Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static int level(String levelString) { if (levelString.equalsIgnoreCase("verbose")) { return 1; } if (levelString.equalsIgnoreCase("debug")) { return 2; } if (levelString.equalsIgnoreCase("info")) { return 3; } if (levelString.equalsIgnoreCase("warn")) { return 4; } if (levelString.equalsIgnoreCase("error")) { return 5; } if (levelString.equalsIgnoreCase("exception")) { return 6; } if (levelString.equalsIgnoreCase("fatal")) { return 7; } return 1; } }