ПОЖАЛУЙСТА, ПРОЧИТАЙТЕ : если у вас есть контракт на поддержку с Google, создайте проблему в консоли поддержки вместо регистрации на GitHub. Это обеспечит своевременный ответ.
process.env.GOOGLE_APPLICATION_CREDENTIALS="path to the credentials";
const {Logging} = require('@google-cloud/logging');
const logging = new Logging({
projectId: "projectId"
});
const logName = 'my-log';
const log = logging.log(logName);
const text = 'Hello, world!';
const metadata = {resource: {type: 'global'}};
const entry = log.entry(metadata, text);
log
.write(entry)
.then(() => {
console.log(`Logged: ${text}`);
})
.catch(err => {
console.error('ERROR:', err);
});
Я получаю эту ошибку
undefined:9
(m.seconds=util.Long.fromValue(d.seconds)).unsigned=false
^
TypeError: util.Long.fromValue is not a function
at Type.Timestamp$fromObject [as fromObject] (eval at Codegen (/home/admin/Documents/projects/new-kroger-api/node_modules/@protobufjs/codegen/index.js:50:33), <anonymous>:9:24)
at Type.fromObject (/home/admin/Documents/projects/new-kroger-api/node_modules/protobufjs/src/type.js:538:25)
at Type.LogEntry$fromObject [as fromObject] (eval at Codegen (/home/admin/Documents/projects/new-kroger-api/node_modules/@protobufjs/codegen/index.js:50:33), <anonymous>:31:24)
at Type.fromObject (/home/admin/Documents/projects/new-kroger-api/node_modules/protobufjs/src/type.js:538:25)
at Type.WriteLogEntriesRequest$fromObject [as fromObject] (eval at Codegen (/home/admin/Documents/projects/new-kroger-api/node_modules/@protobufjs/codegen/index.js:50:33), <anonymous>:30:25)
at Type.fromObject (/home/admin/Documents/projects/new-kroger-api/node_modules/protobufjs/src/type.js:538:25)
at serialize (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/protobuf_js_6_common.js:71:23)
at Object.final_requester.sendMessage (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client_interceptors.js:806:37)
at InterceptingCall._callNext (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client_interceptors.js:419:43)
at InterceptingCall.sendMessage (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client_interceptors.js:464:8)
at InterceptingCall._callNext (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client_interceptors.js:428:12)
at InterceptingCall.sendMessage (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client_interceptors.js:464:8)
at ServiceClient.Client.makeUnaryRequest (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client.js:536:21)
at ServiceClient.method_func (/home/admin/Documents/projects/new-kroger-api/node_modules/grpc/src/client.js:950:43)
at /home/admin/Documents/projects/new-kroger-api/node_modules/@google-cloud/logging/build/src/v2/logging_service_v2_client.js:188:39
at Task.timeoutFunc [as _apiCall] (/home/admin/Documents/projects/new-kroger-api/node_modules/google-gax/build/src/api_callable.js:143:16)
at Task.run (/home/admin/Documents/projects/new-kroger-api/node_modules/google-gax/build/src/bundling.js:195:18)
at BundleExecutor._runNow (/home/admin/Documents/projects/new-kroger-api/node_modules/google-gax/build/src/bundling.js:421:14)
at Timeout._timers.(anonymous function).setTimeout [as _onTimeout] (/home/admin/Documents/projects/new-kroger-api/node_modules/google-gax/build/src/bundling.js:367:22)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5
эта ошибка происходит в позиции log.write Я не знаю, почему она выдает эту ошибку, пожалуйста, помогите мне