How to use the ko/logging.getLogger function in ko

To help you get started, we’ve selected a few ko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / shell.js View on Github external
(function() {

    const {Cc, Ci, Cu}  = require("chrome");
    const prefs         = ko.prefs;

    const log           = require("ko/logging").getLogger("ko-shell");
    const platform      = require("sdk/system").platform;
    const pathSplitter  = platform == "winnt" ? /;/g : /:/g;
    const w             = require("ko/windows").getMain();
    const $             = require("ko/dom");
    //log.setLevel(require("ko/logging").LOG_DEBUG);

    /**
     * Get the current working directory, based on the places pane
     *
     * @returns {String}
     */
    this.getCwd = function()
    {
        // Detect current working directory
        var partSvc = Cc["@activestate.com/koPartService;1"].getService(Ci.koIPartService);
        var cwd = "";
github Defman21 / komodo-terminal-butterfly / content / terminal.js View on Github external
ko.terminal = new function()
{
    const { classes: Cc, interfaces: Ci, utils: Cu } = Components;

    var process;
    var log = require("ko/logging").getLogger("ko-terminal");
    
    this.process = process;
    
    this.commands = {};
    
    this.onerror = (err) =>
    {
        var error = err.split(/\r?\n/);
        var level = "error";
        error = error[error.length - 2];
        if (error.indexOf("[Errno 98]") != -1) {
            error = "Butterfly server is already running";
            level = "warning";
        } else if (error.indexOf("is ready") != -1) {
            error = "Butterfly is ready!";
            level = "info";
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / ui / menu.js View on Github external
var parent = require("./element");
var Module = Object.assign({}, parent);
var $ = require("ko/dom");
var log = require("ko/logging").getLogger("sdk/ui/menu");
//log.setLevel(require("ko/logging").LOG_DEBUG);
module.exports = Module;

/**
 * ko/ui menu element
 * 
 * This module inherits methods and properties from the module it extends.
 * 
 * @module ko/ui/menu
 * @extends module:ko/ui/element~Model
 * @copyright (c) 2017 ActiveState Software Inc.
 * @license Mozilla Public License v. 2.0
 * @author NathanR, CareyH
 * @example
 * var menu = require("ko/ui/menu").create();
 * menupopup.addMenuItem({ label: "Click me!", command: () => console.log("Hello!") });
github Komodo / KomodoEdit / src / modules / kopy / content / kopy.js View on Github external
(function() {
    const log       = require("ko/logging").getLogger("kopy");
    const {Cc, Ci}  = require("chrome");
    const prefs     = ko.prefs;
    const menu      = require("ko/menu");
    const button      = require("ko/button");
    const commands  = require("ko/commands");
    const editor    = require("ko/editor");

    var trackChanges = false;

    var menuContext = [
        {
            select: menu.context.editorContext,
            after: "#editor-context-makeSnippet"
        }
    ];
github Komodo / KomodoEdit / src / modules / scope_openfiles / content / openfiles.js View on Github external
(function() {
    const log       = require("ko/logging").getLogger("commando-scope-openfiles")
    const commando  = require("commando/commando");
    const {Cc, Ci}  = require("chrome");
    
    const partSvc   = Cc["@activestate.com/koPartService;1"].getService(Ci.koIPartService);

    //log.setLevel(require("ko/logging").LOG_DEBUG);

    this.onSearch = function(query, uuid, onComplete)
    {
        log.debug(uuid + " - Starting Scoped Search");

        var curProject = partSvc.currentProject;
        var curPath, curPrefix;

        if (curProject)
        {
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / menu.js View on Github external
(function(){

    const $ = require("ko/dom");
    const log = require("ko/logging").getLogger("sdk-menu");

    const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

    this.context = {
        editorContext: "#editorContextMenu"
    }

    /**
     * Register a new menu item
     * 
     * 
     * @param   {String|Object}     label               Can also be the opts object, containing a label and command entry, doubles as ID
     * @param   {Function}          command             Callback function  
     * @param   {Object}            opts                Options 
     * @param   {string}            opts.id             Identifier
     * @param   {string}            opts.label          The menu label
github Komodo / KomodoEdit / src / modules / scope_files / content / files.js View on Github external
(function() {
    const log       = require("ko/logging").getLogger("commando-scope-files");
    const commando  = require("commando/commando");
    const {Cc, Ci}  = require("chrome");
    const system    = require("sdk/system");
    const ioFile    = require("ko/file");
    const $         = require("ko/dom");
    const sdkUrl    = require("sdk/url");
    const sep       = system.platform == "winnt" ? "\\" : "/";
    const isep      = sep == "/" ? /\\/g : /\//g;
    const pathsep   = system.platform == "winnt" ? ":" : ";";
    const w         = require("ko/windows").getMain();

    const scope     = Cc["@activestate.com/commando/koScopeFiles;1"].getService(Ci.koIScopeFiles);
    const partSvc   = Cc["@activestate.com/koPartService;1"].getService(Ci.koIPartService);
    const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
    const prefs     = require("ko/prefs");
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / jsonrpc.js View on Github external
(function() {
    
    const log       = require("ko/logging").getLogger("jsonrpc");
    
    this.ERROR_PARSING = -32700;
    this.ERROR_INVALID_REQUEST = -32600;
    this.ERROR_METHOD_NOT_FOUND = -32601;
    this.ERROR_INVALID_PARAMS = -32602;
    this.ERROR_INTERNAL = -32603;
    
    var instance = function(socket)
    {
        var reqid = 0;
        var callbacks = { all: [], errors: [] };
        
        var init = () =>
        {
            socket.onData(onData);
github Komodo / KomodoEdit / src / modules / notify / content / sdk / categories.js View on Github external
var logging   = require("ko/logging");
var log       = logging.getLogger("notify-categories");

var categories = {

    register: function(key, opts)
    {
        opts.id = key;
        this._registered[key] = opts;
    },

    unregister: function(key)
    {
        delete this._registered[key];
    },

    get: function(key)
    {
github Komodo / KomodoEdit / src / modules / notify / content / sdk / notify.js View on Github external
(function()
{

    const {Cc, Ci}  = require("chrome");
    const $         = require("ko/dom");
    const editor    = require("ko/editor");
    const timers    = require("sdk/timers");
    const doT       = require("contrib/dot");
    const prefs     = Cc['@activestate.com/koPrefService;1'].getService(Ci.koIPrefService).prefs;
    const logging   = require("ko/logging");
    const winUtils  = require("sdk/window/utils");
    const log       = logging.getLogger("notify");
    const _window   = require("ko/windows").getMain();
    const _         = require("contrib/underscore");
    
    const _document = _window.document;
    const _ko = _window.ko;
    
    //log.setLevel(10);

    var _noWindowWarned = false;

    var notify = this;
    var queue = {};
    var disabledCats = {
        info: prefs.getPref('notify_disabled_categories'),
        warning: prefs.getPref('notify_disabled_categories_warning'),
        error: prefs.getPref('notify_disabled_categories_error')