All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lafaspot.pop.client.SessionLogContext Maven / Gradle / Ivy

The newest version!
/**
 *
 */
package com.lafaspot.pop.client;

import javax.annotation.concurrent.Immutable;

import com.lafaspot.logfast.logging.LogContext;

/**
 * Logger for a single session.
 *
 * @author kraman
 *
 */
@Immutable
public class SessionLogContext extends LogContext {

    /**
     * Initialize the logger context with a name.
     *
     * @param name of the logger
     */
    public SessionLogContext(final String name) {
        super(name);
        debugId = null;
    }

    /**
     * Initialize the logger with name and debug id.
     *
     * @param name of the logger
     * @param debugId session identifier
     */
    public SessionLogContext(final String name, final String debugId) {
        super(name);
        this.debugId = debugId;
    }

    @Override
    public String getSerial() {
        // Log data related to this session
        return "{" + getName() + "," + debugId + "}";
    }

    /** instance id - used for debug. */
    private final String debugId;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy