<commit_before>package org.adligo.i.log.client;

import org.adligo.i.util.client.I_ImutableMap;
import org.adligo.i.util.client.I_Map;
import org.adligo.i.util.client.MapFactory;

/**
 * this class is for sending a log message over http
 * for instance from the browser in GWT
 * or from a phone
 * or remote jvm for stats exc
 * 
 * @author scott
 *
 */
public class LogUrl {
	StringBuffer sb = new StringBuffer();
	/**
	 * the key to a value in the log url
	 * which corresponds to the integers in SimpleLog like LOG_LEVEL_DEBUG
	 */
	public static final String LEVEL = "l";
	/**
	 * the key to the message
	 */
	public static final String MESSAGE = "m";
	/**
	 * the key to the stack trace 
	 */
	public static final String STACK = "s";
	/**
	 * the key to the thread
	 */
	public static final String THREAD = "t";
	/**
	 * the key to the time 
	 */
	public static final String TIME = "ms";
	/**
	 * the name of the Log instance
	 */
	public static final String NAME = "n";
	
	public static final I_ImutableMap URL_ESCAPE_CODES = getUrlEscapeCodes();
	private boolean hasQ = false;
	
	private static I_ImutableMap getUrlEscapeCodes() {
		I_Map toRet = MapFactory.create();
		//copied from http://www.december.com/html/spec/esccodes.html
		toRet.put(new Character(' '), new String("%20"));
		toRet.put(new Character('<'), new String("%3C"));
		toRet.put(new Character('>'), new String("%3E"));
		toRet.put(new Character('#'), new String("%23"));
		toRet.put(new Character('%'), new String("%25"));
		toRet.put(new Character('{'), new String("%7B"));
		toRet.put(new Character('}'), new String("%7D"));
		toRet.put(new Character('|'), new String("%7C"));
		toRet.put(new Character('\\'), new String("%5C"));
		toRet.put(new Character('^'), new String("%5E"));
		toRet.put(new Character('~'), new String("%7E"));
		<commit_msg>this should fix issues when passing a url<commit_after>package org.adligo.i.log.client;

import org.adligo.i.util.client.I_ImmutableMap;
import org.adligo.i.util.client.I_Map;
import org.adligo.i.util.client.MapFactory;

/**
 * this class is for sending a log message over http
 * for instance from the browser in GWT
 * or from a phone
 * or remote jvm for stats exc
 * 
 * @author scott
 *
 */
public class LogUrl {
	StringBuffer sb = new StringBuffer();
	/**
	 * the key to a value in the log url
	 * which corresponds to the integers in SimpleLog like LOG_LEVEL_DEBUG
	 */
	public static final String LEVEL = "l";
	/**
	 * the key to the message
	 */
	public static final String MESSAGE = "m";
	/**
	 * the key to the stack trace 
	 */
	public static final String STACK = "s";
	/**
	 * the key to the thread
	 */
	public static final String THREAD = "t";
	/**
	 * the key to the time 
	 */
	public static final String TIME = "ms";
	/**
	 * the name of the Log instance
	 */
	public static final String NAME = "n";
	
	public static final I_ImmutableMap URL_ESCAPE_CODES = getUrlEscapeCodes();
	private boolean hasQ = false;
	
	private static I_ImmutableMap getUrlEscapeCodes() {
		I_Map toRet = MapFactory.create();
		//copied from http://www.december.com/html/spec/esccodes.html
		toRet.put(new Character(' '), new String("%20"));
		toRet.put(new Character('<'), new String("%3C"));
		toRet.put(new Character('>'), new String("%3E"));
		toRet.put(new Character('#'), new String("%23"));
		toRet.put(new Character('%'), new String("%25"));
		toRet.put(new Character('{'), new String("%7B"));
		toRet.put(new Character('}'), new String("%7D"));
		toRet.put(new Character('|'), new String("%7C"));
		toRet.put(new Character('\\'), new String("%5C"));
		toRet.put(new Character('^'), new String("%5E"));
		toRet.put(new Character('~'), new String("%7E"));
		
{'fraction_non_alphanumeric': 0.16010854816824965, 'fraction_numerical': 0.007598371777476255, 'mean_word_length': 3.875661375661376, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5155310', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1198, 'n_words': 385}