The goog.gears.LogStore Class

goog.gears.LogStore
> goog.gears.BaseStore
> goog.Disposable

goog.gears.LogStore(database, opt_tableName)

Implements a store for goog.debug.Logger data.

database {goog.gears.Database}
Database.
opt_tableName {?string=}
Name of logging table to use.

The goog.gears.LogStore.Query Class

Query to select log records. … more

.addLogRecord(logRecord)

Adds a log record.

logRecord {goog.debug.LogRecord}
the LogRecord.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.createAutoPruneDelay(opt_count, opt_interval)

Create new delay object for auto-pruning. Does not stop or start auto-pruning, call #startAutoPrune and #startAutoPrune for that.

opt_count {?number=}
Number of records of recent hitory to keep.
opt_interval {?number=}
Milliseconds to wait before next pruning.

.createSchema(defs, opt_ifNotExists)

Inherited from goog.gears.BaseStore .

Creates tables and indicies in the target database.

defs {Array}
definition arrays. This is an array of objects where each object describes a database object to create and drop. each object contains a 'type' field which of type goog.gears.BaseStore.SchemaType. Each object also contains a 'name' which contains the name of the object to create. A table object contains a 'columns' field which is an array that contains the column definitions for the table. A virtual table object contains c 'columns' field which contains the name of the columns. They are assumed to be of type text. An index object contains a 'tableName' field which is the name of the table that the index is on. It contains an 'isUnique' field which is a boolean indicating whether the index is unqiue or not. It also contains a 'columns' field which is an array that contains the columns names (possibly along with the ordering) that form the index. The trigger objects contain a 'tableName' field indicating the table the trigger is on. The type indicates the type of trigger. The trigger object may include a 'when' field which contains the when clause for the trigger. The trigger object also contains an 'actions' field which is an array of strings containing the actions for this trigger.
opt_ifNotExists {boolean=}
true if the table or index should be created only if it does not exist. Otherwise trying to create a table or index that already exists will result in an exception being thrown.

.createTriggers(defs)

Inherited from goog.gears.BaseStore .

Creates triggers specified in definitions. Will first attempt to drop the trigger with this name first.

defs {Array}
Definition arrays.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.dropSchema(defs)

Inherited from goog.gears.BaseStore .

Drops tables and indicies in a target database.

defs {Array}
Definition arrays.

.ensureStoreExists()

Inherited from goog.gears.BaseStore .

Makes sure that tables needed for the store exist and are up to date.

.flush()

Flush buffered log records.

.getName()

Inherited from goog.gears.BaseStore .

Returns the name of the store.

returns {string}
The name of the store.

.getStoreVersion()

Inherited from goog.gears.BaseStore .

Returns the version number for the specified store

returns {number}
The version number of the store. Returns 0 if the store does not exist.

.hasIndex(name)

Inherited from goog.gears.BaseStore .

Returns true if the index exists in the database

name {string}
The index name.
returns {boolean}
Whether the index exists in the database.

.hasTable(name)

Inherited from goog.gears.BaseStore .

Returns true if the table exists in the database

name {string}
The table name.
returns {boolean}
Whether the table exists in the database.

.hasTrigger(name)

Inherited from goog.gears.BaseStore .

name {string}
The name of the trigger.
returns {boolean}
Whether the schema contains a trigger with the given name.

.isAutoPruneActive()

returns {boolean}
True iff auto prune timer is active.

.isCapturing()

Whether we are currently capturing logger output.

returns {boolean}
Whether we are currently capturing logger output.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.pruneBeforeCount(opt_count)

Keep some number of most recent log records and delete all older ones.

opt_count {?number=}
Number of records of recent history to keep. If unspecified, we use #goog.gears.LogStore.DEFAULT_PRUNE_KEEPER_COUNT_. Pass in 0 to delete all log records.

.pruneBeforeSequenceNumber(sequenceNumber)

Delete log record #id and all older records.

sequenceNumber {number}
ID before which we delete all records.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.removeStore()

Inherited from goog.gears.BaseStore .

Removes the tables for the MessageStore

.removeStoreVersion()

Inherited from goog.gears.BaseStore .

Removes the version number for the specified store

.select(query)

Select log records.

query {goog.gears.LogStore.Query}
Query object.
returns {Array.<goog.debug.LogRecord>}
Selected logs in descending order of creation time.

.setCapturing(capturing)

Sets whether we are currently capturing logger output.

capturing {boolean}
Whether to capture logger output.

.startAutoPrune()

Enable periodic pruning. As a side effect, this also flushes the memory buffer.

.stopAutoPrune()

Disable scheduled pruning.