本文整理汇总了TypeScript中raven.config函数的典型用法代码示例。如果您正苦于以下问题:TypeScript config函数的具体用法?TypeScript config怎么用?TypeScript config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了config函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1:
export = (app: Application) => {
// If sentry is configured, report all logged errors
if (process.env.SENTRY_DSN) {
app.log.debug(process.env.SENTRY_DSN, 'Errors will be reported to Sentry')
Raven.disableConsoleAlerts()
Raven.config(process.env.SENTRY_DSN, {
autoBreadcrumbs: true
}).install()
app.log.target.addStream(sentryStream(Raven))
}
}
开发者ID:brntbeer,项目名称:probot,代码行数:12,代码来源:sentry.ts
示例2: Error
import * as Raven from 'raven';
const dsn = '___DSN___';
const client = Raven.config(dsn, { autoBreadcrumbs: true }).install();
Raven.config(dsn, {
logger: 'logger',
parseUser: ['id', 'name'],
autoBreadcrumbs: false,
});
console.log(Raven.version);
Raven.config(dsn).install({ captureUnhandledRejections: true });
client.setContext({});
client.on('logged', () => { });
client.process({});
client.captureMessage('Broken!', (err, eventId) => { });
new Raven.Client({ name: 'YAY!' });
new Raven.Client(dsn, { name: 'YAY!' });
new Raven.Client(dsn);
try {
throw new Error();
} catch (e) {
const eventId = Raven.captureException(e, (sendErr, eventId) => { });
}
Raven.setContext({});
Raven.mergeContext({});
Raven.context(() => {
Raven.captureBreadcrumb({});
});
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:31,代码来源:raven-tests.ts
示例3: require
import * as bodyParser from "koa-bodyparser";
import * as session from "koa-session-minimal";
import * as views from "koa-views";
// tslint:disable-next-line:no-var-requires
const sessionStore: any = require("koa-sqlite3-session");
import * as mount from "koa-mount";
import * as serve from "koa-static";
import * as cors from "koa2-cors";
import { dbPath, SENTRY_URL } from "./lib/config";
import log from "./lib/log";
import router from "./routes";
import { config, captureException } from "raven";
const app = new Koa();
config(SENTRY_URL).install();
app.use(
cors({
origin: ctx => (ctx.url.startsWith("/api") ? "*" : false),
allowMethods: ["POST"],
})
);
app.use(async (ctx: Koa.Context, next: () => any) => {
try {
await next();
ctx.set("X-Powered-By", "Clover");
// Handle 404 upstream.
const status = ctx.status || 404;
if (status >= 400) {
ctx.throw(status);
}
开发者ID:coderfox,项目名称:Another-SS-Panel,代码行数:31,代码来源:server.ts
示例4: require
import { Dispatcher } from './Dispatcher/Dispatcher'
import { NotFound } from './NotFound'
import fs from './fs'
import { getCommandId } from './util'
import { getFid, initStatusChecker, getStatusChecker } from './StatusChecker'
import * as updateNotifier from 'update-notifier'
import chalk from 'chalk'
import * as Raven from 'raven'
import * as os from 'os'
import * as jwt from 'jsonwebtoken'
import { getIsGlobal } from './utils/isGlobal'
import { CommandReplacedError } from './errors/CommandReplacedError'
import { CommandRemovedError } from './errors/CommandRemovedError'
Raven.config(
'https://1e57780fb0bb4b52938cbb3456268121:[email protected]/271168',
).install()
const debug = require('debug')('cli')
const handleEPIPE = err => {
Raven.captureException(err)
if (err.code !== 'EPIPE') {
throw err
}
}
let out: Output
if (!global.testing) {
process.once('SIGINT', () => {
if (out) {
if (out.action.task) {
开发者ID:dhruvcodeword,项目名称:prisma,代码行数:31,代码来源:CLI.ts
示例5: Error
import * as Raven from 'raven';
const dsn = '___DSN___';
const client = Raven.config(dsn, { autoBreadcrumbs: true }).install();
Raven.config(dsn, {
logger: 'logger',
parseUser: ['id', 'name'],
autoBreadcrumbs: false,
});
console.log(Raven.version);
Raven.config({
release: 'foobar'
});
client.setContext({});
client.on('logged', () => { });
client.process({});
client.captureMessage('Broken!', (err, eventId) => { });
new Raven.Client({ name: 'YAY!' });
new Raven.Client(dsn, { name: 'YAY!' });
new Raven.Client(dsn);
try {
throw new Error();
} catch (e) {
const eventId = Raven.captureException(e, (sendErr, eventId) => { });
}
Raven.setContext({});
Raven.mergeContext({});
开发者ID:Dru89,项目名称:DefinitelyTyped,代码行数:31,代码来源:raven-tests.ts
示例6: main
async function main() {
// initialize sentry
Raven.config(sentryDSN).install()
const env = defaultEnvironment()
const displayQuickstart = shouldDisplayQuickstart()
const {command, props}: CommandInstruction = await parseCommand(process.argv, version, env)
switch (command) {
case undefined: {
process.stdout.write(usageRoot(displayQuickstart))
process.exit(0)
}
case 'init': {
await checkAuth(env, 'init')
await initCommand(props as InitProps, env)
break
}
case 'interactiveInit': {
await interactiveInitCommand(props as InteractiveInitProps, env)
break
}
case 'push': {
await checkAuth(env, 'auth')
await pushCommand(props as PushProps, env)
break
}
case 'delete': {
await checkAuth(env, 'auth')
await deleteCommand(props as DeleteProps, env)
break
}
case 'pull': {
await checkAuth(env, 'auth')
await pullCommand(props as PullProps, env)
break
}
case 'export': {
await checkAuth(env, 'auth')
await exportCommand(props as ExportProps, env)
break
}
case 'status': {
await checkAuth(env, 'auth')
await statusCommand(props as StatusProps, env)
break
}
case 'endpoints': {
await checkAuth(env, 'auth')
await endpointsCommand(props as EndpointsProps, env)
break
}
case 'console': {
await checkAuth(env, 'auth')
await consoleCommand(props as ConsoleProps, env)
break
}
case 'playground': {
await checkAuth(env, 'auth')
await playgroundCommand(props as PlaygroundProps, env)
break
}
case 'projects': {
await checkAuth(env, 'auth')
await projectsCommand({}, env)
break
}
case 'auth': {
await authCommand(props as AuthProps, env, new GraphcoolAuthServer('auth'))
break
}
case 'quickstart': {
await quickstartCommand({}, env)
break
}
case 'help': {
process.stdout.write(usageRoot(displayQuickstart))
process.exit(0)
break
}
case 'version': {
process.stdout.write(version)
//.........这里部分代码省略.........
开发者ID:sadeeqaji,项目名称:graphcool-cli,代码行数:101,代码来源:index.ts
示例7: constructor
constructor(config: SentryNotifierConfig, mainConfig: Config) {
super()
this.config = config
this.mainConfig = mainConfig
this.raven = config.ravenClient || Raven.config(config.dsn, config.ravenOpts).install()
}
开发者ID:instructure,项目名称:ftl-engine,代码行数:6,代码来源:SentryNotifier.ts
示例8: Error
import * as Raven from 'raven';
const dsn = '___DSN___';
const client = Raven.config(dsn, { autoBreadcrumbs: true }).install();
console.log(Raven.version);
Raven.config(dsn).install({ captureUnhandledRejections: true });
client.setContext({});
client.on('logged', () => { });
client.process({});
client.captureMessage('Broken!', (err, eventId) => { });
new Raven.Client({ name: 'YAY!' });
new Raven.Client(dsn, { name: 'YAY!' });
new Raven.Client(dsn);
try {
throw new Error();
} catch (e) {
const eventId = Raven.captureException(e, (sendErr, eventId) => { });
}
Raven.setContext({});
Raven.mergeContext({});
Raven.context(() => {
Raven.captureBreadcrumb({});
});
setTimeout(Raven.wrap(() => {}), 1000);
Raven.parseDSN('https://8769c40cf49c4cc58b51fa45d8e2d166:[email protected]/269');
开发者ID:Crevil,项目名称:DefinitelyTyped,代码行数:28,代码来源:raven-tests.ts
注:本文中的raven.config函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论