getLocation

Get location of log.
ie. filename and line number

@return {Obsject}
@return {String}     filename
@return {Number}     line
326613
function () {

        var st     = stack()[2],
            result = {};

        result.filename = path.basename(st.getFileName());
        result.line = st.getLineNumber();

        return result;
    }
1094835
public String getLocationAsString() {

        if (null != locator) {
            StringBuilder sbuffer  = new StringBuilder();
            String       systemID = locator.getSystemId();
            int          line     = locator.getLineNumber();
            int          column   = locator.getColumnNumber();

            if (null != systemID) {
                sbuffer.append("; SystemID: ");
                sbuffer.append(systemID);
            }

            if (0 != line) {
                sbuffer.append("; Line#: ");
                sbuffer.append(line);
            }

            if (0 != column) {
                sbuffer.append("; Column#: ");
                sbuffer.append(column);
            }

            return sbuffer.toString();
        } else {
            return null;
        }
    }
1026369
private int getLogFileIndex(String fileName) {
		int fileIndex = 0;
		try {
			fileIndex = Integer.parseInt(fileName.substring(fileName
					.lastIndexOf(COUNT_SEPARATOR) + 1));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return fileIndex;
	}
1063761
function (msg) {

            if (!isLog()) {
                return undefined;
            }

            if (msg) {
                console.log(_utils.now() + " " + msg);
                this.log2file(msg);
            }
        }
593306
function _getCalleeFilename(calls) {
    calls = (calls|0) + 3; // 3 is a number of inner calls
    const e = {};
    Error.captureStackTrace(e);
    return parseStackLine(e.stack.split(/\n/)[calls]).filename;
}
233051
public URI getLocation() {
        if (locationURI == null) {
            locationURI = moduleRef != null ? moduleRef.getLocation() : null;
            if (locationURI == null) {
                locationURI = classpathElement.getURI();
            }
        }
        return locationURI;
    }
669501
def get_location(self):
        
        origin = self._frame.canvas.origin
        return (self._x + origin[0] + self._offset,
                self._y + origin[1] - self._frame.canvas.start_line)
1077826
public String getLogLocation() {
        if (logInstanceBrowser instanceof MainLogRepositoryBrowserImpl) {
            return ((MainLogRepositoryBrowserImpl) logInstanceBrowser).getLocation().getAbsolutePath();
        } else {
            return ((OneInstanceBrowserImpl) logInstanceBrowser).getLocation().getAbsolutePath();
        }

    }
909455
public static String location(Node node) {
        String name;
        int idx;

        if (node instanceof ZipNode) {
            name = ((ZipNode) node).getRoot().getZip().getName();
            idx = name.lastIndexOf('/');
            if (idx >= 0) {
                name = name.substring(idx + 1);
            }
            return "zip:" + name + "/" + node.getPath();
        } else if (node instanceof FileNode) {
            return "file:" + node.getRelative(node.getWorld().getWorking());
        } else if (node instanceof HttpNode) {
            return "http:" + node.getName() + ((HttpNode) node).getQuery();
        } else {
            return node.getName();
        }
    }
939198
def location(self):
        
        if self._location is None:
            self._location = "{}/{}-{}".format(
                self.stream,
                self.type,
                self.sequence,
            )
        return self._location
502142
function getPlace() {
      var place = 0;
      while (takenPlaces.indexOf(place) !== -1) {
        place++;
      }
      takenPlaces.push(place);
      return place;
    }
306853
public Point getLocation() {
    assertElementNotStale();

    String coordinates =
        debugger.callFunctionOnObject("var coords = " + OperaAtom.GET_LOCATION
                                      + "(locator); return coords.x + ',' + coords.y;", objectId);

    // TODO: The goog.dom.getDocumentScrollElement_() function the Google closure library doesn't
    // return the document for SVG documents. This is used by the above atom. In this case the
    // coordinates string will be empty, so we use this fallback to get the coordinates. Hopefully
    // a fix will be forthcoming in the closure library.
    if (coordinates.isEmpty()) {
      logger.warning("Falling back to non-atom positioning code in getLocation");
      coordinates =
          debugger.callFunctionOnObject("var coords = locator.getBoundingClientRect();"
                                        + "return (coords.left-window.pageXOffset)+','+(coords.top-window.pageYOffset)",
                                        objectId);
    }

    String[] location = coordinates.split(",");
    return new Point(Integer.valueOf(location[0]), Integer.valueOf(location[1]));
  }
885565
function getLocation(url){
    var m = url.toLowerCase().match(reURI);
    var proto = m[2], domain = m[3], port = m[4] || "";
    if ((proto == "http:" && port == ":80") || (proto == "https:" && port == ":443")) {
        port = "";
    }
    return proto + "//" + domain + port;
}
1372894
function getLocation(template, loc){
  if (loc)
    return (template.sourceUrl || '') + ':' + loc.start.line + ':' + (loc.start.column + 1);
}
1154206
function getPos(lines, lineNum, code, indicator) {

	var line, min, max, dots = false, prefix = 0;
	var pos = {};

	// console.log('code', code);

	// handle special cases
	if (code === '{{{{') {
		pos.min = 0;
		pos.max = 4;
		return pos;
	} else if (code === '{{{') {
		pos.min = 0;
		pos.max = 3;
		return pos;
	} else  if (code === '{{') {
		pos.min = 0;
		pos.max = 2;
		return pos;
	} else if (code.indexOf('{{<') !== -1) {
		pos.min = lines[lineNum].indexOf('{{<');
		pos.max = pos.min + 3;
		return pos;
	} else if (code === '{{}}') {
		pos.min = 0;
		pos.max = 4;
		return pos;
	} else if (code.indexOf('{{{}}{') !== -1) {
		pos.min = lines[lineNum].indexOf('{{{}}}');
		pos.max = pos.min + 6;
		return pos;
	} else if (code.indexOf('{{#}}') !== -1) {
		pos.min = lines[lineNum].indexOf('{{#}}');
		pos.max = pos.min + 5;
		return pos;
	}

	// trim off extra prefix and suffix from code which
	// could force us to not find the pos in the line.
	code = code.substring(0, indicator.length);
	code = code.replace('...', function() {
		dots = true;
		return '';
	});

	prefix = code.indexOf('{{');
	line = lines[lineNum];
	min = line.indexOf(code);
	min = min + prefix;
	max = (!dots)
		? min + indicator.length - 1
		: min + indicator.length - 4;

	// todo: if (min === max) max = findMax(line, min); // find first ' ' or '}'
	if (min === max) max++;

	if (min === -1) {
		return {
			min: 0,
			max: 1
		};
	} else {
		return {
			min: min,
			max: max
		};
	}
}
811893
public String getLocation(Class<?> clazz) {

        String filename = clazz.getName().replace('.', '/');
        int pos = filename.lastIndexOf('/') + 1;
        return (pos > 0 ? filename.substring(0, pos) : "");
    }
1050966
function getSeedsAtLocation(location) {
  // load the file as JSON
  const result = require(location);

  // Ensure the output is an array
  if (Array.isArray(result)) {
    return _.forEach(result, unmarshalBuffer);
  } else {
    return [ unmarshalBuffer(result) ];
  }
}